Tool Calls
When you’d rather not wire up your own MCP client, the SDK exposesigris.mcp —
a small JSON-RPC client that speaks to the Igris gateway directly. Every call
is policy-evaluated, identity-tagged, and audit-logged exactly the same way
external MCP clients are.
When to use this
Both paths route through the same gateway, hit the same policies, and produce the same audit events.
API
McpConfigOptions:
Quick Start
https://api.igrisecurity.com/v1/mcp/<slug>, carries Authorization: Bearer <apiKey>, and is policy-evaluated server-side before being forwarded to the upstream MCP server with its real credential injected.
Threading multiple calls under one trace
If a single user request triggers several tool calls, share the trace id so Lens can show the whole chain as one operation:traceId = "trace-...", which lets you
filter Lens to the full sequence.
Error handling
igris.mcp methods (igris.mcp.initialize, igris.mcp.listTools, igris.mcp.callTool) throw
plain Error instances — not the typed IgrisError subclasses. The error message includes the
HTTP status and response body:
IgrisPolicyDeniedError, IgrisRateLimitError, IgrisAuthError) apply
only to igris.chat.completions, igris.embeddings, and igris.connections — resources that use
fetchWithRetry internally. igris.mcp uses a plain fetch call.
Handle igris.mcp errors with a standard try/catch:
What gets logged
Everyinitialize, listTools, and callTool produces an audit event with:
- The actor (
user, derived fromX-Igris-User) - The connection slug
- The tool name and arguments (for
callTool) - The policy decision (
allow/deny/alert) - Any matched rule and conditions
- The trace id (
X-Igris-Trace-Id) - All metadata fields (
X-Igris-Metadata) - The timing and outcome
Related
- Connections — how to register the upstream MCP server and store its credential
- Identity & Metadata — what the gateway does with
user,traceId, andmetadata - Policies — how to gate
tools/callby tool name, user, or metadata - MCP Client Config — the alternative path: drive an external MCP client