.graphql file in your operations directory becomes a tool with a name, description, and input schema.
Creating Operations
Create a directory for your operations (as specified in your storage provider configuration) and add.graphql or .gql files containing GraphQL operations.
Each file should contain a single operation. Named operations are recommended, but if an operation is unnamed, the filename (without extension) is used as the operation name.
Use triple-quoted description strings (following the September 2025 GraphQL spec) to provide descriptions for AI models:
Only triple-quoted description strings (
"""...""") are supported. Standard GraphQL comments (# comment) are not extracted as tool descriptions.Validation
Operations are validated against your GraphQL schema at load time. Invalid operations are logged as errors and skipped — they will not appear as MCP tools. Subscription operations are not supported and are also skipped.Mutation Operations
Mutations follow the same pattern. The MCP server automatically adds a warning that the operation has side effects:Directory Structure
Here’s an example of how your project directory should be structured:- The path in your
storage_providers.file_system.pathshould point to the operations directory - All
.graphqland.gqlfiles in this directory and subdirectories will be loaded - Each file should contain a single GraphQL operation
- Duplicate operation names across files are rejected (the second file is skipped with an error log)
Tool Naming
The MCP server converts each operation into a corresponding tool:| Operation Name | Tool Name |
|---|---|
GetUsers | execute_operation_get_users |
CreateUser | execute_operation_create_user |
GetUserById | execute_operation_get_user_by_id |
snake_case for tool naming consistency.
Tool Schema
The tool’s input schema is automatically generated from your GraphQL operation’s variables, ensuring type safety. AI models use this schema to understand what parameters are required and their types.Omitting the Tool Name Prefix
By default, all operation tools include theexecute_operation_ prefix. You can enable omit_tool_name_prefix to generate shorter tool names:
| Operation Name | Default | With omit_tool_name_prefix |
|---|---|---|
GetUsers | execute_operation_get_users | get_users |
CreateUser | execute_operation_create_user | create_user |
Operations with names that would collide with any already-registered tool (including built-in tools like
get_schema, execute_graphql, get_operation_info, or a previously registered operation) automatically retain the execute_operation_ prefix to prevent conflicts.Best Practices
Write Effective Descriptions
Descriptions are the most important part of your operations for AI consumption. A good description tells the AI model:- What data the operation provides or changes
- When to use this operation (and when not to)
- What is excluded or restricted (especially for security-sensitive data)
Design for AI Consumption
Use meaningful names
Give operations clear, action-oriented names that describe what they do:
GetActiveUsers, SearchProducts, CreateSupportTicket.Use explicit types
Define all input variables with explicit types to ensure proper validation and help AI models understand required inputs.
Create focused operations
Design operations specifically for AI model consumption rather than exposing generic operations. An operation that returns exactly what the AI needs is better than one that returns everything.