Use the Tool Client for Agentic workflows
mainFor agents or orchestration scripts requiring direct MCP tool access, use the stitch object or instantiate StitchToolClient for explicit configuration (like custom API keys or base URLs). The client auto-connects on the first tool call.
import { StitchToolClient } from "@google/stitch-sdk";
const client = new StitchToolClient({ apiKey: "your-api-key" });
const result = await client.callTool("create_project", {
title: "Agent Project",
});
await client.close();