Skip to content

Commit 829ed35

Browse files
authored
removed LLMCallable content block from custom tools article (#621)
1 parent 1791c3d commit 829ed35

1 file changed

Lines changed: 0 additions & 76 deletions

File tree

src/content/docs/agentkit/tools/custom-tools.mdx

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -144,82 +144,6 @@ async function slackSendMessage(identifier: string, channel: string, text: strin
144144
</TabItem>
145145
</Tabs>
146146

147-
## Expose as an LLM-callable tool
148-
149-
Define a JSON Schema for each custom tool and pass the list to your LLM. The schema format below matches what Scalekit returns for built-in tools, so it works directly with the Anthropic API. For OpenAI, rename `input_schema` to `parameters`.
150-
151-
<Tabs syncKey="tech-stack">
152-
<TabItem label="Python">
153-
```python
154-
custom_tools = [
155-
{
156-
"name": "gmail_list_filters",
157-
"description": "List Gmail filters configured for the current user",
158-
"input_schema": {
159-
"type": "object",
160-
"properties": {"identifier": {"type": "string"}},
161-
"required": ["identifier"],
162-
},
163-
},
164-
{
165-
"name": "slack_send_message",
166-
"description": "Send a message to a Slack channel on behalf of the user",
167-
"input_schema": {
168-
"type": "object",
169-
"properties": {
170-
"identifier": {"type": "string"},
171-
"channel": {"type": "string"},
172-
"text": {"type": "string"},
173-
},
174-
"required": ["identifier", "channel", "text"],
175-
},
176-
},
177-
]
178-
179-
def route_tool_call(tool_name: str, tool_input: dict):
180-
if tool_name == "gmail_list_filters":
181-
return gmail_list_filters(tool_input["identifier"])
182-
if tool_name == "slack_send_message":
183-
return slack_send_message(tool_input["identifier"], tool_input["channel"], tool_input["text"])
184-
raise ValueError(f"Unknown tool: {tool_name}")
185-
```
186-
</TabItem>
187-
<TabItem label="Node.js">
188-
```typescript
189-
const customTools = [
190-
{
191-
name: 'gmail_list_filters',
192-
description: 'List Gmail filters configured for the current user',
193-
input_schema: {
194-
type: 'object',
195-
properties: { identifier: { type: 'string' } },
196-
required: ['identifier'],
197-
},
198-
},
199-
{
200-
name: 'slack_send_message',
201-
description: 'Send a message to a Slack channel on behalf of the user',
202-
input_schema: {
203-
type: 'object',
204-
properties: {
205-
identifier: { type: 'string' },
206-
channel: { type: 'string' },
207-
text: { type: 'string' },
208-
},
209-
required: ['identifier', 'channel', 'text'],
210-
},
211-
},
212-
];
213-
214-
function routeToolCall(toolName: string, toolInput: Record<string, string>) {
215-
if (toolName === 'gmail_list_filters') return gmailListFilters(toolInput.identifier);
216-
if (toolName === 'slack_send_message') return slackSendMessage(toolInput.identifier, toolInput.channel, toolInput.text);
217-
throw new Error(`Unknown tool: ${toolName}`);
218-
}
219-
```
220-
</TabItem>
221-
</Tabs>
222-
223147
## Check authorization before proxy calls
224148

225149
Verify the connected account is `ACTIVE` before making a proxy call and handle provider errors explicitly:

0 commit comments

Comments
 (0)