Skip to main content
The MCP server gives AI models a set of tools they can discover and execute. It exposes two kinds:
  • 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 .graphql file. The operation determines the tool’s name, description, input schema, and the data it returns.

Built-in Tools

get_schema and execute_graphql are disabled by default because they expose your full API surface to AI models. Enable them with expose_schema: true and enable_arbitrary_operations: true respectively, and only when arbitrary access is intended. Prefer creating focused 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.
Each file becomes a tool that AI models can call. The tool’s name is derived from the operation name (see Tool Naming), its description from the operation’s description string (see Tool Descriptions), and its input schema from the operation’s variables (see Tool Schema). The MCP server marks mutation tools as non-read-only and non-idempotent through MCP tool annotations, signaling to AI clients that the tool has side effects.
To prevent AI models from making unintended changes, consider setting exclude_mutations: true in your configuration until you’ve validated your mutation tools thoroughly.

Directory Structure

Use this directory structure:
Key points:
  • The path in your storage_providers.file_system.path should point to this directory
  • All .graphql and .gql files 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 the execute_operation_ prefix. You can enable omit_tool_name_prefix to generate shorter tool names:
Enabling this option changes all tool names and may break existing integrations that rely on the execute_operation_ prefix. Only enable this for new deployments or when you can update all dependent systems.
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:
If no description is provided, the description of the queried root field from your graph’s schema is used instead (see Field Descriptions). If neither exists, a default description is generated from the operation name and type.
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 default values.
  • 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:
Each description becomes the description of the corresponding property in the tool’s input schema:
Both single-quoted ("...") 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.
Given this schema:
An operation without any descriptions:
produces a fully described tool. The root field description becomes the tool’s description, and the type and field descriptions land in the input schema:
Descriptions in the operation take priority over descriptions from the schema:
  • 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.