Presumably LLMs could easily help generate EQL queries from non technical user's free text queries by using the Pathom metadata? Has anyone written an MCP for this based on the existing ability for introspection? e.g. as used by pathom-viz?
hi @mark354, I have tried some of that last year, the results weren't very good, it worked for simple queries but for more complex it was hard for it to get it right. that said, models have improved and I haven't tried with new ones
let me see if I can find the snippets that I used to share with you
I used a custom mcp impl (that I unfortunally cnat share, but its easy to replace with some existing one), for the rest you can find it here: https://gist.github.com/wilkerlucio/ae688fea85b761c4c45cd7e6d78ea4d0
I've had pretty great luck with this on a recent project. I wrote a pathom EQL endpoint over a set of Redmine (ticket system) REST API endpoints. I exposed the EQL endpoint as a graph query tool in my MCP server, with few shot examples of how to structure queries. I also gave it a docs tool to find attrs for each entity (IE: tickets, sprints, users, time entries, commits) I compared that against a more "vanilla" MCP server that only exposed the core REST APIs (with some convenience tooling, like "My issues") Claude worked very well with the EQL tool, and handled errors pretty gracefully. When compared with the vanilla MCP tool, it burns way less tokens because it can make one call and ask for the result shape it wants to satisfy the user query This is with Claude code Opus 4.6. YMMV
Thanks both. I've already had luck with Claude 4.6 building queries without any help based on existing patterns and working things out based on my source code (defresolver, defmutation) but it did occasionally have problems and didn't understand always that pathom could do most of the work when writing its own resolvers, and I definitely couldn't let users write their own queries! I'll experiment thank you both!