Skip to main content
Create custom tools, or extend a catalog tool, to build exactly what your agent needs.

Extend a catalog tool

Use nango pull to fetch tools from the catalog into your Nango functions project. For example, to fetch GitHub’s get-repository tool:
The CLI adds the tool’s source to your project and imports it from index.ts. From there you can edit it by following the steps in create a custom tool. Nango updates catalog tools automatically, which can change what they accept or return. For backend calls, use nango pull --catalog and deploy the copy as a custom tool. You can deploy it as-is. Your integration uses the version you deployed, and you decide when to update it.

Create a custom tool

First, set up a Nango functions project. This example defines a tool that creates a GitHub issue.
github/tools/create-issue.ts
Import the tool from your project’s root index.ts:
index.ts
  • The tool name defaults to its filename without the extension. In this example, the name is create-issue.
  • Read the tool’s arguments from input. Nango validates them against your input schema before running the tool.
  • Use meta.requiredScopes to describe the provider permissions the tool needs. Use scopes.all(...), scopes.any(...), or scopes.none(). The field is informational and not enforced by Nango.
  • Use meta.tags to annotate the tool with labels such as its category or operation type (read, write, potentially destructive, etc.).
    • Nango catalog tools use read_only_hint, destructive_hint, and idempotent_hint to indicate whether a tool is read-only, can make destructive changes, or can be repeated with the same effect.
See the createTool SDK reference for all options. To fail a tool call, throw new nango.Error(...) inside exec. Nango returns your error message to the caller. In an agent session, the agent receives the message, so explain what went wrong and what it can do next.
For details on error messages and response format, see Errors in the Functions SDK.

Test and deploy

Create a test connection in the Connections tab, then dry run the tool with realistic input:
A dry run calls real provider APIs and can create or change data. See Testing and CI/CD.

Call a custom tool

Once deployed, call a custom tool from your agent or backend the same way you call a catalog tool.