Use this file to discover all available pages before exploring further.
Tool calling in Nango happens through action functions. Each tool is an action function that an agent, LLM SDK, or MCP client can call on demand for a specific connection.The agent chooses a tool, your application asks Nango to execute the action function for that connection, and Nango handles the external API credentials, retries, rate limits, and logs.
Keep provider credentials out of the agent runtime. Your app should resolve the Nango connection for the current user, then pass only the connection ID and selected tool to Nango.
import { Nango } from '@nangohq/node';const nango = new Nango({ secretKey: process.env.NANGO_SECRET_KEY! });const integrationId = 'hubspot';async function getConnectionIdForUser(userId: string) { const connections = await nango.listConnections({ integrationId, tags: { end_user_id: userId } }); let connectionId = connections.connections[0]?.connection_id; if (!connectionId) { const session = await nango.createConnectSession({ allowed_integrations: [integrationId], tags: { end_user_id: userId } }); // Send this URL to the user in your app, then wait for authorization. console.log(session.data.connect_link); const connection = await nango.waitForConnection(integrationId, userId); connectionId = connection!.connection_id; } return connectionId;}async function executeNangoTool(actionName: string, input?: unknown) { const connectionId = await getConnectionIdForUser('user_123'); return await nango.triggerAction(integrationId, connectionId, actionName, input);}
The examples below focus on framework-specific tool syntax and call the shared executeNangoTool() helper.
The Get integration functions config API returns enabled action function definitions. Use it when an agent or orchestration layer should discover available tools at runtime.
Nango exposes enabled action functions through a hosted MCP server:
https://api.nango.dev/mcp
The server supports Streamable HTTP transport. Requests must include:
Header
Value
Authorization
Bearer <ENV-SECRET-KEY>
connection-id
The connection whose credentials should be used
provider-config-key
The integration ID
Example client setup with the MCP TypeScript SDK:
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';const transport = new StreamableHTTPClientTransport(new URL('https://api.nango.dev/mcp'), { requestInit: { headers: { Authorization: `Bearer ${process.env.NANGO_SECRET_KEY}`, 'connection-id': '<CONNECTION-ID>', 'provider-config-key': '<INTEGRATION-ID>' } }});
For desktop clients that only support stdio, use a bridge such as mcp-remote and pass the same headers. Keep the header spacing exactly as required by the bridge you choose.
If you are implementing this flow programmatically, first list or create the user’s connection, then call GET /scripts/config to discover enabled action functions, and finally execute tools with POST /action/trigger or the MCP server.Required values for every execution are the Nango secret key, integration ID, connection ID, action function name, and input payload.
Every action function execution appears in Nango logs. Use logs to debug failed tool calls, inspect provider requests, and review agent behavior.Keep tool names and descriptions specific. Expose only action functions the agent is allowed to call for the current user and workflow. For write operations, make action function logic idempotent before using async execution or retries.