Skip to content

Commit 5fbfa11

Browse files
update(docs): update mcp, custom tools, and variables docs
1 parent 842aa2c commit 5fbfa11

17 files changed

+239
-49
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
title: Custom Tools
3+
description: Extend your agents with your own functions — defined by a schema and executed as JavaScript
4+
---
5+
6+
import { Callout } from 'fumadocs-ui/components/callout'
7+
8+
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.
9+
10+
## What Is a Custom Tool?
11+
12+
A custom tool has three parts:
13+
14+
| Part | Description |
15+
|------|-------------|
16+
| **Schema** | OpenAI function-calling format — name, description, and parameters. This is what the agent sees when deciding whether to call the tool. |
17+
| **Code** | JavaScript that runs when the tool is called. Parameters come in as variables matching the schema. |
18+
| **Scope** | Custom tools are workspace-scoped and available to every agent in that workspace. |
19+
20+
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.
21+
22+
## Creating a Custom Tool
23+
24+
1. Navigate to **Settings → Custom Tools**
25+
2. Click **Add**
26+
3. Fill out the **Schema** tab with your function definition
27+
4. Write your implementation in the **Code** tab
28+
5. Click **Save**
29+
30+
<Callout type="info">
31+
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.
32+
</Callout>
33+
34+
## Schema Format
35+
36+
Custom tool schemas follow the OpenAI function-calling spec:
37+
38+
```json
39+
{
40+
"type": "function",
41+
"function": {
42+
"name": "get_weather",
43+
"description": "Get the current weather for a city",
44+
"parameters": {
45+
"type": "object",
46+
"properties": {
47+
"city": {
48+
"type": "string",
49+
"description": "The city to get weather for"
50+
}
51+
},
52+
"required": ["city"]
53+
}
54+
}
55+
}
56+
```
57+
58+
The `name` must be lowercase, use underscores, and match what your code expects as input.
59+
60+
## Using Custom Tools in Agents
61+
62+
Once created, your tools become available in any Agent block:
63+
64+
1. Open an **Agent** block
65+
2. In the **Tools** section, click **Add tool…**
66+
3. Under **Custom Tools**, click the tool you want to add
67+
4. The agent can now call the tool the same way it calls MCP tools or built-in tools
68+
69+
## Custom Tools vs MCP Tools
70+
71+
| | **Custom Tools** | **MCP Tools** |
72+
|---|---|---|
73+
| **Defined** | Inline — schema + code in Sim | External MCP server |
74+
| **Hosting** | Runs inside Sim | Runs on your server |
75+
| **Best for** | Small, workspace-specific helpers | Shared tools, third-party services, complex integrations |
76+
| **Setup** | One modal | Deploy and register a server |
77+
78+
## Permission Requirements
79+
80+
| Action | Required Permission |
81+
|--------|-------------------|
82+
| Create or update custom tools | **Write** or **Admin** |
83+
| Delete custom tools | **Admin** |
84+
| Use custom tools in agents | **Read**, **Write**, or **Admin** |

apps/docs/content/docs/en/mcp/deploy-workflows.mdx

Lines changed: 67 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Deploy Workflows as MCP
33
description: Expose your workflows as MCP tools for external AI assistants and applications
44
---
55

6+
import { Image } from '@/components/ui/image'
67
import { Video } from '@/components/ui/video'
78
import { Callout } from 'fumadocs-ui/components/callout'
89
import { FAQ } from '@/components/ui/faq'
@@ -18,10 +19,45 @@ MCP servers group your workflow tools together. Create and manage them in worksp
1819
</div>
1920

2021
1. Navigate to **Settings → MCP Servers**
21-
2. Click **Create Server**
22+
23+
<div className="flex justify-center">
24+
<Image
25+
src="/static/blocks/mcp-servers-settings.png"
26+
alt="MCP Servers settings page"
27+
width={700}
28+
height={450}
29+
className="my-6"
30+
/>
31+
</div>
32+
33+
2. Click **Add**
2234
3. Enter a name and optional description
23-
4. Copy the server URL for use in your MCP clients
24-
5. View and manage all tools added to the server
35+
36+
<div className="flex justify-center">
37+
<Image
38+
src="/static/blocks/mcp-server-add-modal.png"
39+
alt="Add New MCP Server modal"
40+
width={550}
41+
height={380}
42+
className="my-6"
43+
/>
44+
</div>
45+
46+
4. Click **Add Server**
47+
5. Click **Details** to view the MCP server
48+
49+
<div className="flex justify-center">
50+
<Image
51+
src="/static/blocks/mcp-server-details.png"
52+
alt="MCP Server details view"
53+
width={700}
54+
height={450}
55+
className="my-6"
56+
/>
57+
</div>
58+
59+
6. Copy the server URL for use in your MCP clients
60+
7. View and manage all tools added to the server
2561

2662
## Adding a Workflow as a Tool
2763

@@ -33,9 +69,21 @@ Once your workflow is deployed, you can expose it as an MCP tool:
3369

3470
1. Open your deployed workflow
3571
2. Click **Deploy** and go to the **MCP** tab
72+
73+
<div className="flex justify-center">
74+
<Image
75+
src="/static/blocks/mcp-deploy-modal.png"
76+
alt="Workflow Deployment MCP tab"
77+
width={380}
78+
height={470}
79+
className="my-6"
80+
/>
81+
</div>
82+
3683
3. Configure the tool name and description
3784
4. Add descriptions for each parameter (helps AI understand inputs)
3885
5. Select which MCP servers to add it to
86+
6. Click **Save Tool**
3987

4088
<Callout type="info">
4189
The workflow must be deployed before it can be added as an MCP tool.
@@ -54,27 +102,25 @@ Your workflow's input format fields become tool parameters. Add descriptions to
54102

55103
## Connecting MCP Clients
56104

57-
Use the server URL from settings to connect external applications:
58-
59-
### Claude Desktop
60-
Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):
105+
Sim generates a ready-to-paste configuration for every supported client. To get it:
61106

62-
```json
63-
{
64-
"mcpServers": {
65-
"my-sim-workflows": {
66-
"command": "npx",
67-
"args": ["-y", "mcp-remote", "YOUR_SERVER_URL"]
68-
}
69-
}
70-
}
71-
```
72-
73-
### Cursor
74-
Add the server URL in Cursor's MCP settings using the same mcp-remote pattern.
107+
1. Navigate to **Settings → MCP Servers**
108+
2. Click **Details** on your server
109+
3. Under **MCP Client**, select your client — **Cursor**, **Claude Code**, **Claude Desktop**, **VS Code**, or **Sim**
110+
4. Copy the configuration, replacing `$SIM_API_KEY` with your Sim API key
111+
112+
<div className="flex justify-center">
113+
<Image
114+
src="/static/blocks/mcp-client-config.png"
115+
alt="MCP client configuration panel"
116+
width={700}
117+
height={450}
118+
className="my-6"
119+
/>
120+
</div>
75121

76122
<Callout type="warn">
77-
Include your API key header (`X-API-Key`) for authenticated access when using mcp-remote or other HTTP-based MCP transports.
123+
Every request must include the `X-API-Key` header for authenticated access.
78124
</Callout>
79125

80126
## Server Management

apps/docs/content/docs/en/mcp/index.mdx

Lines changed: 59 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,58 @@ MCP is an open standard that enables AI assistants to securely connect to extern
1818
- Execute custom tools and scripts
1919
- Maintain secure, controlled access to external resources
2020

21-
## Configuring MCP Servers
21+
## Adding a MCP Server as a Tool
2222

23-
MCP servers provide collections of tools that your agents can use. Configure them in workspace settings:
23+
MCP servers provide collections of tools that your agents can use.
2424

2525
<div className="mx-auto w-full overflow-hidden rounded-lg">
2626
<Video src="mcp/settings-mcp-tools.mp4" width={700} height={450} />
2727
</div>
2828

29-
1. Navigate to your workspace settings
30-
2. Go to the **MCP Servers** section
31-
3. Click **Add MCP Server**
32-
4. Enter the server configuration details
33-
5. Save the configuration
29+
To add one:
30+
31+
1. Navigate to **Settings → MCP Tools**
32+
33+
<div className="flex justify-center">
34+
<Image
35+
src="/static/blocks/mcp-settings.png"
36+
alt="MCP Tools settings page"
37+
width={700}
38+
height={450}
39+
className="my-6"
40+
/>
41+
</div>
42+
43+
2. Click **Add** to open the configuration modal
44+
3. Enter a **Server Name** and **Server URL**
45+
4. Add any required **Headers** (e.g. API keys)
46+
5. Click **Add MCP** to save
47+
48+
<div className="flex justify-center">
49+
<Image
50+
src="/static/blocks/mcp-add-modal.png"
51+
alt="Add New MCP Server modal"
52+
width={450}
53+
height={290}
54+
className="my-6"
55+
/>
56+
</div>
3457

3558
<Callout type="info">
3659
You can also configure MCP servers directly from the toolbar in an Agent block for quick setup.
3760
</Callout>
3861

3962
### Refresh Tools
4063

41-
Click **Refresh** on a server to fetch the latest tool schemas and automatically update any agent blocks using those tools with the new parameter definitions.
64+
To auto-refresh an MCP tool already in use by an agent, go to **Settings → MCP Tools**, open the server's details, and click **Refresh**. This fetches the latest tool schemas and automatically updates any agent blocks using those tools with the new parameter definitions.
4265

4366
## Using MCP Tools in Agents
4467

4568
Once MCP servers are configured, their tools become available within your agent blocks:
4669

4770
<div className="flex justify-center">
4871
<Image
49-
src="/static/blocks/mcp-2.png"
72+
src="/static/blocks/mcp-agent-dropdown.png"
5073
alt="Using MCP Tool in Agent Block"
5174
width={700}
5275
height={450}
@@ -55,17 +78,33 @@ Once MCP servers are configured, their tools become available within your agent
5578
</div>
5679

5780
1. Open an **Agent** block
58-
2. In the **Tools** section, you'll see available MCP tools
59-
3. Select the tools you want the agent to use
60-
4. The agent can now access these tools during execution
81+
2. In the **Tools** section, click **Add tool…**
82+
3. Under **MCP Servers**, click a server to see its tools
83+
84+
<div className="flex justify-center">
85+
<Image
86+
src="/static/blocks/mcp-agent-tools.png"
87+
alt="MCP tools list for a selected server"
88+
width={400}
89+
height={400}
90+
className="my-6"
91+
/>
92+
</div>
93+
94+
4. Select individual tools, or choose **Use all N tools** to add every tool from that server
95+
5. The agent can now access these tools during execution
96+
97+
<Callout type="info">
98+
If you haven't configured a server yet, click **Add MCP Server** at the top of the dropdown to open the setup modal without leaving the block.
99+
</Callout>
61100

62101
## Standalone MCP Tool Block
63102

64103
For more granular control, you can use the dedicated MCP Tool block to execute specific MCP tools:
65104

66105
<div className="flex justify-center">
67106
<Image
68-
src="/static/blocks/mcp-3.png"
107+
src="/static/blocks/mcp-tool-block.png"
69108
alt="Standalone MCP Tool Block"
70109
width={700}
71110
height={450}
@@ -79,17 +118,14 @@ The MCP Tool block allows you to:
79118
- Use the tool's output in subsequent workflow steps
80119
- Chain multiple MCP tools together
81120

82-
### When to Use MCP Tool vs Agent
83-
84-
**Use Agent with MCP tools when:**
85-
- You want the AI to decide which tools to use
86-
- You need complex reasoning about when and how to use tools
87-
- You want natural language interaction with the tools
121+
## When to Use MCP Tool vs Agent
88122

89-
**Use MCP Tool block when:**
90-
- You need deterministic tool execution
91-
- You want to execute a specific tool with known parameters
92-
- You're building structured workflows with predictable steps
123+
| | **Agent with MCP tools** | **MCP Tool block** |
124+
|---|---|---|
125+
| **Execution** | AI decides which tools to call | Deterministic — runs the tool you pick |
126+
| **Parameters** | AI chooses at runtime | You set them explicitly |
127+
| **Best for** | Dynamic, conversational flows | Structured, repeatable steps |
128+
| **Reasoning** | Handles complex multi-step logic | One tool, one call |
93129

94130
## Permission Requirements
95131

apps/docs/content/docs/en/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"connections",
1313
"---Features---",
1414
"mcp",
15+
"custom-tools",
1516
"copilot",
1617
"mailer",
1718
"skills",

0 commit comments

Comments
 (0)