Create a tool
In your functions project, add a tool and import it fromindex.ts:
github/tools/create-issue.ts
index.ts
trigger.input. Nango validates the input against the schema before execution. meta.requiredScopes documents provider permissions with scopes.all(...), scopes.any(...), or scopes.none(); Nango does not enforce them. Tools can also read connection metadata and save checkpoints when you declare data.metadata or data.checkpoint schemas. See createTool for all options.
To fail a call with a custom payload, throw new nango.Error({ ... }). The tool-call API returns it as error.payload with the function_runtime_error code.
Test and deploy
Create a test connection in the Connections tab, then dry run the tool with realistic input:Call a tool
Use a Nango Environment API key from Environment Settings > API Keys. Scoped keys needenvironment:tools:call.
- cURL
- TypeScript
input for tools that take no input, sending {} as the request body.
Expose tools to an agent
Use agent sessions to scope tools and connections to a tenant. Tools participate intoolset, allow, deny, and pinned_tools policies and can be discovered through nango_tool_search.
For coding agents managing Nango, the Management MCP server exposes tools_call.