Skip to content

Commit 43512a5

Browse files
committed
docs: add docs on the validate tool
1 parent ffbcf92 commit 43512a5

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

crates/apollo-mcp-server/src/introspection/tools/execute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl Execute {
3636
mutation_mode,
3737
tool: Tool::new(
3838
EXECUTE_TOOL_NAME,
39-
"Execute a GraphQL operation. Use the `introspect` tool to get information about the GraphQL schema. Always use the schema to create operations - do not try arbitrary operations. If available, first use the `validate` tool to validate operations. DO NOT try to execute introspection queries.",
39+
"Execute a GraphQL operation. Use the `introspect` tool first to get information about the GraphQL schema. Always use the schema to create operations - do not try arbitrary operations. If available, first use the `validate` tool to validate operations. DO NOT try to execute introspection queries.",
4040
schema_from_type!(Input),
4141
),
4242
}

docs/source/command-reference.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ These fields are under the top-level `introspection` key.
142142
| `introspect.enabled` | `bool` | `false` | Enable introspection requests |
143143
| `search` | `object` | | Search tool configuration |
144144
| `search.enabled` | `bool` | `false` | Enable search tool |
145+
| `validate` | `object` | | Validation tool configuration |
146+
| `validate.enabled` | `bool` | `false` | Enable validation tool |
145147

146148

147149
#### Logging configuration

docs/source/guides/index.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ You can enable the following introspection tools:
161161

162162
- `introspect` - allows the AI model to introspect the schema of the GraphQL API by providing a specific type name to get information about, and a depth parameter to determine how deep to traverse the subtype hierarchy. The AI model can start the introspection by looking up the top-level `Query` or `Mutation` type.
163163
- `search` - allows the AI model to search for type information by providing a set of search terms. This can result in fewer tool calls than `introspect`, especially if the desired type is deep in the type hierarchy of the schema. Search results include all the parent type information needed to construct operations involving the matching type.
164+
- `validate` - validates a GraphQL operation against the schema without executing it. This allows AI models to verify that their operations are syntactically correct and conform to the schema before execution, preventing unintended side effects. Operations should be validated prior to calling the `execute` tool.
164165
- `execute` - executes an operation on the GraphQL endpoint
165166

166167
The MCP client can use these tools to provide schema information to the model and its context window, and allow the model to execute GraphQL operations based on that schema.
@@ -177,6 +178,8 @@ introspection:
177178
enabled: true
178179
introspect:
179180
enabled: true
181+
validate:
182+
enabled: true
180183
```
181184

182185
```sh title="Example command using introspection"

0 commit comments

Comments
 (0)