- Built-in tools provided by the server itself, for discovering your API and, optionally, running arbitrary GraphQL.
- Tools you create, each defined by a GraphQL operation in a
.graphqlfile. The operation determines the tool’s name, description, input schema, and the data it returns.
Built-in Tools
Creating Tools
Create a directory for your tools (as specified in your storage provider configuration) and add.graphql or .gql files containing GraphQL operations.
Each file defines a single tool through a single operation. Named operations are recommended, but if an operation is unnamed, the filename (without extension) is used as the operation name.
Directory Structure
Use this directory structure:- The path in your
storage_providers.file_system.pathshould point to this directory - All
.graphqland.gqlfiles in this directory and subdirectories will be loaded - Duplicate operation names across files are rejected (the second file is skipped with an error log)
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.Tool Naming
Each tool’s name is derived from its operation name:
Operation names are converted to
snake_case for tool naming consistency.
Omitting the Tool Name Prefix
By default, all operation-defined tools include theexecute_operation_ prefix. You can enable omit_tool_name_prefix to generate shorter tool names:
Tools whose names would collide with any already-registered tool (including the built-in tools or
a previously registered operation) are skipped and logged as errors. Rename the operation to avoid the conflict.
Tool Descriptions
The description is the primary way AI models understand what a tool does and when to use it. Set it with a description string on the operation, following the September 2025 GraphQL spec:Only description strings (
"""...""" or "...") are supported. Standard GraphQL comments (# comment) are not
extracted as tool descriptions.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. The generated schema reflects your operation and graph schema:- Non-nullable variables are listed as
required. - Variable default values become
defaultvalues. - Descriptions on variable definitions become property descriptions. See Variable Descriptions.
- Descriptions defined in your graph’s schema are included automatically. See Field Descriptions.
Variable Descriptions
Add a description string before a variable definition to describe that parameter to AI models. This follows the September 2025 GraphQL spec:description of the corresponding property in the tool’s input schema:
"...") and triple-quoted ("""...""") strings are supported for variable descriptions.
The router strips operation and variable descriptions before forwarding the operation to your subgraphs. Subgraph servers do not need to support the September 2025 GraphQL spec.
Variable descriptions require router version 0.316.0 or above.
Field Descriptions
Descriptions defined in your graph’s schema are carried into the generated tool. You do not need to repeat them in the operation:- The description of the queried root field becomes the tool description when the operation has no description of its own.
- Input object type descriptions become the description of the corresponding variable property.
- Input object field descriptions become the descriptions of nested properties.
- Enum and custom scalar type descriptions are included wherever those types are used.
- An operation description replaces the root field description as the tool description.
- A variable description replaces the schema-derived description for that property.
Descriptions on field arguments are not propagated. To describe a variable that maps to a plain argument, add a
variable description in the operation.
Best Practices
Write Effective Descriptions
Descriptions are the most important part of a tool for AI consumption. A good description tells the AI model:- What data the tool provides or changes
- When to use this tool (and when not to)
- What is excluded or restricted (especially for security-sensitive data)
Design for AI Consumption
1
Use meaningful names
Give operations clear, action-oriented names that describe what the tool does:
GetActiveUsers, SearchProducts,
CreateSupportTicket.2
Use explicit types
Define all input variables with explicit types to ensure proper validation and help AI models understand required
inputs.
3
Describe your variables
Add a description to each variable. Descriptions appear in the
tool’s input schema and tell AI models what each parameter means, its expected format, and any constraints.
4
Create focused tools
Design each tool specifically for AI model consumption rather than exposing generic operations. A tool that
returns exactly what the AI needs is better than one that returns everything.
5
Add safety checks for mutations
For mutation tools, add checks and validations in your backend to prevent misuse. Consider requiring
confirmation parameters for destructive operations.