-
Notifications
You must be signed in to change notification settings - Fork 3.5k
update(docs): update mcp, custom tools, and variables docs #4192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| --- | ||
| title: Custom Tools | ||
| description: Extend your agents with your own functions — defined by a schema and executed as JavaScript | ||
| --- | ||
|
|
||
| import { Callout } from 'fumadocs-ui/components/callout' | ||
|
|
||
| Custom Tools let you define your own functions that agents can call, without needing an external MCP server. You write a JSON schema describing the function and the JavaScript code that runs when the agent invokes it. | ||
|
|
||
| ## What Is a Custom Tool? | ||
|
|
||
| A custom tool has three parts: | ||
|
|
||
| | Part | Description | | ||
| |------|-------------| | ||
| | **Schema** | OpenAI function-calling format — name, description, and parameters. This is what the agent sees when deciding whether to call the tool. | | ||
| | **Code** | JavaScript that runs when the tool is called. Parameters come in as variables matching the schema. | | ||
| | **Scope** | Custom tools are workspace-scoped and available to every agent in that workspace. | | ||
|
|
||
| Use custom tools when you need tightly-scoped logic that doesn't warrant spinning up a full MCP server — one-off API calls, formatting helpers, internal utilities, etc. | ||
|
|
||
| ## Creating a Custom Tool | ||
|
|
||
| 1. Navigate to **Settings → Custom Tools** | ||
| 2. Click **Add** | ||
| 3. Fill out the **Schema** tab with your function definition | ||
| 4. Write your implementation in the **Code** tab | ||
| 5. Click **Save** | ||
|
|
||
| <Callout type="info"> | ||
| You can also create a custom tool directly from an Agent block — click **Add tool… → Create Tool** in the tool dropdown. The schema editor has an AI-generation option that drafts the schema from a plain-English description. | ||
| </Callout> | ||
|
|
||
| ## Schema Format | ||
|
|
||
| Custom tool schemas follow the OpenAI function-calling spec: | ||
|
|
||
| ```json | ||
| { | ||
| "type": "function", | ||
| "function": { | ||
| "name": "get_weather", | ||
| "description": "Get the current weather for a city", | ||
| "parameters": { | ||
| "type": "object", | ||
| "properties": { | ||
| "city": { | ||
| "type": "string", | ||
| "description": "The city to get weather for" | ||
| } | ||
| }, | ||
| "required": ["city"] | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| The `name` must be lowercase, use underscores, and match what your code expects as input. | ||
|
|
||
| ## Using Custom Tools in Agents | ||
|
|
||
| Once created, your tools become available in any Agent block: | ||
|
|
||
| 1. Open an **Agent** block | ||
| 2. In the **Tools** section, click **Add tool…** | ||
| 3. Under **Custom Tools**, click the tool you want to add | ||
| 4. The agent can now call the tool the same way it calls MCP tools or built-in tools | ||
|
|
||
| ## Custom Tools vs MCP Tools | ||
|
|
||
| | | **Custom Tools** | **MCP Tools** | | ||
| |---|---|---| | ||
| | **Defined** | Inline — schema + code in Sim | External MCP server | | ||
| | **Hosting** | Runs inside Sim | Runs on your server | | ||
| | **Best for** | Small, workspace-specific helpers | Shared tools, third-party services, complex integrations | | ||
| | **Setup** | One modal | Deploy and register a server | | ||
|
|
||
| ## Permission Requirements | ||
|
|
||
| | Action | Required Permission | | ||
| |--------|-------------------| | ||
| | Create or update custom tools | **Write** or **Admin** | | ||
| | Delete custom tools | **Admin** | | ||
| | Use custom tools in agents | **Read**, **Write**, or **Admin** | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ | |
| "connections", | ||
| "---Features---", | ||
| "mcp", | ||
| "custom-tools", | ||
| "copilot", | ||
| "mailer", | ||
| "skills", | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.