You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/define-tools.mdx
+13-19Lines changed: 13 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,9 +86,9 @@ operations:
86
86
87
87
For graphs managed by GraphOS, Apollo MCP Server can get operations by reading persisted queries from GraphOS. The MCP Server uses Apollo Uplink to access the persisted queries.
88
88
89
-
To use GraphOS persisted queries, you must:
89
+
To use GraphOS persisted queries, you must set your graph credentials `APOLLO_GRAPH_REF` and `APOLLO_KEY` as environment variables.
90
90
91
-
- Set `APOLLO_GRAPH_REF` and `APOLLO_KEY` environment variables for a GraphOS graph
91
+
Use the `operations.source: uplink` option to specify that tools should be loaded from GraphOS-managed persisted queries.
92
92
93
93
<Tip>
94
94
@@ -97,17 +97,8 @@ Use a [contract variant](/graphos/platform/schema-management/delivery/contracts/
97
97
</Tip>
98
98
99
99
```yaml title="Example config using GraphOS-managed persisted queries"
100
-
headers:
101
-
"apollographql-client-name": "my-web-app"
102
100
operations:
103
101
source: uplink
104
-
schema:
105
-
source: local
106
-
path: <absolute path to this git repo>/graphql/weather/api.graphql
107
-
```
108
-
109
-
```sh title="Example command using GraphOS-managed persisted queries"
110
-
apollo-mcp-server <path to the preceding config>
111
102
```
112
103
113
104
The MCP Server supports hot reloading of GraphOS-managed persisted queries, so it can automatically pick up changes from GraphOS without restarting.
@@ -116,16 +107,23 @@ If you register a persisted query with a specific client name instead of `null`,
116
107
117
108
Use the `headers` option when running the MCP Server to pass the header to the router. The default name of the header expected by the router is `apollographql-client-name`. To use a different header name, configure `telemetry.apollo.client_name_header` in router YAML configuration.
118
109
110
+
```yaml title="Example config using GraphOS-managed persisted queries" {1-2}
111
+
headers:
112
+
"apollographql-client-name": "my-web-app"
113
+
operations:
114
+
source: uplink
115
+
```
116
+
119
117
## Introspection tools
120
118
121
119
In addition to defining specific tools for pre-defined GraphQL operations, Apollo MCP Server supports introspection tools that enable AI agents to explore the graph schema and execute operations dynamically.
122
120
123
121
You can enable the following introspection tools:
124
122
125
-
- `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.
126
-
- `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.
127
-
- `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.
128
-
- `execute`- executes an operation on the GraphQL endpoint
123
+
- `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.
124
+
- `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.
125
+
- `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.
126
+
- `execute`:executes an operation on the GraphQL endpoint
129
127
130
128
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.
0 commit comments