For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
Search mode
Apply progressive disclosure by replacing the full MCP tool list with two meta tools, get_tool and invoke_tool.
In Search mode, an MCP backend exposes two meta tools instead of the upstream tool list:
get_toollooks up an upstream tool by name or description.invoke_toolcalls an upstream tool by name with its arguments.
The client never sees the full tool catalog, which keeps the model’s context small even when the backend fronts many upstream tools. This pattern is commonly called progressive disclosure, because the model reads a tool’s definition only at the point where it needs the tool.
For background and a comparison with the other tool modes, see MCP tool modes.
Before you begin
Install the Solo Enterprise for agentgateway control plane by following the quick start guide.Step 1: Deploy an MCP server
Deploy a sample MCP server that exposes a single fetch tool. If you already deployed this server for another tool mode, skip this step.
kubectl apply -f- <<EOF
apiVersion: apps/v1
kind: Deployment
metadata:
name: mcp-website-fetcher
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: mcp-website-fetcher
template:
metadata:
labels:
app: mcp-website-fetcher
spec:
containers:
- name: mcp-website-fetcher
image: ghcr.io/peterj/mcp-website-fetcher:main
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8000
name: http
---
apiVersion: v1
kind: Service
metadata:
name: mcp-website-fetcher
namespace: default
labels:
app: mcp-website-fetcher
spec:
selector:
app: mcp-website-fetcher
ports:
- name: http
port: 80
targetPort: 8000
EOFStep 2: Create the EnterpriseAgentgatewayBackend
Create an MCP backend with toolMode: Search.
kubectl apply -f- <<EOF
apiVersion: enterpriseagentgateway.solo.io/v1alpha1
kind: EnterpriseAgentgatewayBackend
metadata:
name: mcp-search-backend
namespace: default
spec:
entMcp:
toolMode: Search
targets:
- name: fetcher
static:
host: mcp-website-fetcher.default.svc.cluster.local
port: 80
protocol: SSE
EOFStep 3: Route traffic to the backend
Attach the backend to your Gateway with an HTTPRoute. The path prefix is rewritten to /mcp so the upstream MCP server sees its expected path.
kubectl apply -f- <<EOF
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: mcp-search
namespace: default
spec:
parentRefs:
- name: agentgateway-proxy
namespace: agentgateway-system
rules:
- matches:
- path:
type: PathPrefix
value: /mcp/search
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplacePrefixMatch
replacePrefixMatch: /mcp
backendRefs:
- name: mcp-search-backend
group: enterpriseagentgateway.solo.io
kind: EnterpriseAgentgatewayBackend
EOFStep 4: Verify the connection
Get the external address of the gateway and save the MCP endpoint in the
MCP_URLenvironment variable. The remaining commands in this step reuse this variable, so the curl examples work for both connection types.export INGRESS_GW_ADDRESS=$(kubectl get svc -n agentgateway-system agentgateway-proxy -o jsonpath="{.status.loadBalancer.ingress[0]['hostname','ip']}") echo $INGRESS_GW_ADDRESS export MCP_URL="http://${INGRESS_GW_ADDRESS}/mcp/search" echo $MCP_URLOpen a port-forward in a separate terminal.
kubectl port-forward -n agentgateway-system svc/agentgateway-proxy 8080:80Then set the endpoint variable.
export MCP_URL="http://localhost:8080/mcp/search"
Initialize an MCP session and send the
notifications/initializedacknowledgement. The session ID is returned in themcp-session-idresponse header.curl -sS -D /tmp/hdr -o /tmp/init -X POST "$MCP_URL" \ -H 'Content-Type: application/json' \ -H 'Accept: application/json, text/event-stream' \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}' SID=$(awk -F': *' 'tolower($1)=="mcp-session-id"{gsub(/\r/,"",$2);print $2}' /tmp/hdr) curl -sS -X POST "$MCP_URL" \ -H "Mcp-Session-Id: $SID" \ -H 'Content-Type: application/json' \ -H 'Accept: application/json, text/event-stream' \ -d '{"jsonrpc":"2.0","method":"notifications/initialized"}'List the tools.
curl -sS -X POST "$MCP_URL" \ -H "Mcp-Session-Id: $SID" \ -H 'Content-Type: application/json' \ -H 'Accept: application/json, text/event-stream' \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'Example output: Search mode exposes exactly two tools,
get_toolandinvoke_tool. The upstreamfetchtool is not in the list.data: {"jsonrpc":"2.0","id":2,"result":{"tools":[{"name":"get_tool","description":"Get information about available tools. Use 'name' for exact lookup by tool name. Hits return {\"results\": [...]}. Lookup misses return {\"results\": [], \"status\": \"no_match\", \"available_tools\": [...]}. Available tools: [fetch]","inputSchema":{"type":"object","properties":{"name":{"type":"string","description":"Exact tool name. Use a name you have already seen from this server in the current session."}},"required":["name"]},"outputSchema":{"type":"object","properties":{"results":{"type":"array","description":"Matching tools. Exact lookup returns one result on hit and an empty array on miss.","items":{"type":"object","properties":{"name":{"type":"string","description":"The name of the tool."},"tool_description":{"type":"string","description":"The description of the tool."},"args":{"type":"object","description":"The input argument schema for the tool."}},"required":["name","tool_description","args"]}},"status":{"type":"string","description":"Optional status for successful lookup misses. `no_match` means the lookup completed successfully but found no tool."},"available_tools":{"type":"array","description":"Available tool names returned on a lookup miss to help the next exact lookup.","items":{"type":"string"}}},"required":["results"]}},{"name":"invoke_tool","description":"Invoke a tool by name with the given arguments. Use get_tool first to discover available tools and their required arguments.","inputSchema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the tool to invoke."},"arguments":{"type":"object","description":"The arguments to pass to the tool."}},"required":["name"]}}]}}Look up the
fetchtool withget_tool. Theget_toolaccepts anameargument and returns matching tools across all targets in the backend. Tools that the caller is not authorized to use are filtered out. When the caller passes a partial or descriptive name, the gateway returns the closest matches rather than failing.curl -sS -X POST "$MCP_URL" \ -H "Mcp-Session-Id: $SID" \ -H 'Content-Type: application/json' \ -H 'Accept: application/json, text/event-stream' \ -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_tool","arguments":{"name":"fetch"}}}'Example output: The response includes the tool’s description and input schema.
data: {"jsonrpc":"2.0","id":3,"result":{"structuredContent":{"results":[{"name":"fetch","tool_description":"Fetches a website and returns its content","args":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"URL to fetch"}}}}]},"isError":false}}Invoke the tool with
invoke_tool. Theargumentsfield contains the upstream tool’s input.curl -sS -X POST "$MCP_URL" \ -H "Mcp-Session-Id: $SID" \ -H 'Content-Type: application/json' \ -H 'Accept: application/json, text/event-stream' \ -d '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"invoke_tool","arguments":{"name":"fetch","arguments":{"url":"https://example.com"}}}}'Example output: The response is the upstream tool’s normal result, returned through
invoke_tool.data: {"jsonrpc":"2.0","id":4,"result":{"content":[{"type":"text","text":"<!doctype html><html lang=\"en\"><head><title>Example Domain</title><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><style>body{background:#eee;width:60vw;margin:15vh auto;font-family:system-ui,sans-serif}h1{font-size:1.5em}div{opacity:0.8}a:link,a:visited{color:#348}</style></head><body><div><h1>Example Domain</h1><p>This domain is for use in documentation examples without needing permission. Avoid use in operations.</p><p><a href=\"https://iana.org/domains/example\">Learn more</a></p></div></body></html>\n"}],"isError":false}}
Cleanup
kubectl delete httproute mcp-search -n default
kubectl delete enterpriseagentgatewaybackend mcp-search-backend -n default
kubectl delete deployment mcp-website-fetcher -n default
kubectl delete service mcp-website-fetcher -n default