Docs / Capability guide
MCP tools and governed agents
Discover available tools and configure agent permissions and action limits.
All capabilities · Related guide · Agent prompt for this capability
When to use this example
Before building a campaign assistant or operations agent, find out which tools its credential can see and what each tool expects. A saved catalog helps you plan an integration around the actual deployment and permissions.
What the example gives you
The discovery client opens an MCP session, saves the available tool schemas and closes the session. It does not call tools. The guide covers the additional identity, signature and approval requirements for an agent that takes actions.
Before you start
An agent gateway URL and API key. Acting as a registered AgentIdentity also requires its signing key and declared scope.
Run the example
Extract the archive and follow README.md for setup, commands, and expected results. Start with mcp_discover.py. Local tests use sample data.
Python tools accept --help. To connect to your workspace, supply the deployment URLs, credentials and resource IDs required by the tool.
Connect it to your application
Run mcp_discover.py to initialize POST /mcp, retain the returned session header and list tools. Read each tool’s input schema before constructing calls.
Start with read-only tools. For a registered agent, use the signing procedure in the MCP guide; adding agent_id without a valid signature is rejected. Keep the configured tenant ID when processing tool results.
For mutations preserve reason, idempotency and approval requirements. Handle awaiting-approval, denied, timeout and typed errors explicitly; inspect the audit trail and stop when a kill switch trips.
Check the result
A restricted key sees only its permitted catalog. Session initialization succeeds; wrong credentials and out-of-scope calls fail. Discovery does not execute tools or change a tenant.