Create tool configurations for a Sim integration by reading API docs
56
63%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
High
Do not use without reviewing
Fix and improve this skill with Tessl
tessl review fix ./.agents/skills/add-tools/SKILL.mdYou are an expert at creating tool configurations for Sim integrations. Your job is to read API documentation and create properly structured tool files.
When the user asks you to create tools for a service:
If the docs do not clearly show the response JSON for a tool, you MUST tell the user exactly which outputs are unknown and stop short of guessing.
transformResponse against unverified payloadsIf the response shape is unknown, do one of these instead:
Create files in apps/sim/tools/{service}/:
tools/{service}/
├── index.ts # Barrel export
├── types.ts # Parameter & response types
└── {action}.ts # Individual tool files (one per operation)Every tool MUST follow this exact structure:
import type { {ServiceName}{Action}Params } from '@/tools/{service}/types'
import type { ToolConfig } from '@/tools/types'
interface {ServiceName}{Action}Response {
success: boolean
output: {
// Define output structure here
}
}
export const {serviceName}{Action}Tool: ToolConfig<
{ServiceName}{Action}Params,
{ServiceName}{Action}Response
> = {
id: '{service}_{action}', // snake_case, matches tool name
name: '{Service} {Action}', // Human readable
description: 'Brief description', // One sentence
version: '1.0.0',
// OAuth config (if service uses OAuth)
oauth: {
required: true,
provider: '{service}', // Must match OAuth provider ID
},
params: {
// Hidden params (system-injected, only use hidden for oauth accessToken)
accessToken: {
type: 'string',
required: true,
visibility: 'hidden',
description: 'OAuth access token',
},
// User-only params (credentials, api key, IDs user must provide)
someId: {
type: 'string',
required: true,
visibility: 'user-only',
description: 'The ID of the resource',
},
// User-or-LLM params (everything else, can be provided by user OR computed by LLM)
query: {
type: 'string',
required: false, // Use false for optional
visibility: 'user-or-llm',
description: 'Search query',
},
},
request: {
url: (params) => `https://api.service.com/v1/resource/${params.id}`,
method: 'POST',
headers: (params) => ({
Authorization: `Bearer ${params.accessToken}`,
'Content-Type': 'application/json',
}),
body: (params) => ({
// Request body - only for POST/PUT/PATCH
// Trim ID fields to prevent copy-paste whitespace errors:
// userId: params.userId?.trim(),
}),
},
transformResponse: async (response: Response) => {
const data = await response.json()
return {
success: true,
output: {
// Map API response to output
// Use ?? null for nullable fields
// Use ?? [] for optional arrays
},
}
},
outputs: {
// Define each output field
},
}'hidden' - System-injected (OAuth tokens, internal params). User never sees.'user-only' - User must provide (credentials, api keys, account-specific IDs)'user-or-llm' - User provides OR LLM can compute (search queries, content, filters, most fall into this category)'string' - Text values'number' - Numeric values'boolean' - True/false'json' - Complex objects (NOT 'object', use 'json')'file' - Single file'file[]' - Multiple filesrequired: true or required: falserequired: false'string', 'number', 'boolean' - Primitives'json' - Complex objects (use this, NOT 'object')'array' - Arrays with items property'object' - Objects with properties propertyAdd optional: true for fields that may not exist in the response:
closedAt: {
type: 'string',
description: 'When the issue was closed',
optional: true,
},When using type: 'json' and you know the object shape in advance, always define the inner structure using properties so downstream consumers know what fields are available:
// BAD: Opaque json with no info about what's inside
metadata: {
type: 'json',
description: 'Response metadata',
},
// GOOD: Define the known properties
metadata: {
type: 'json',
description: 'Response metadata',
properties: {
id: { type: 'string', description: 'Unique ID' },
status: { type: 'string', description: 'Current status' },
count: { type: 'number', description: 'Total count' },
},
},For arrays of objects, define the item structure:
items: {
type: 'array',
description: 'List of items',
items: {
type: 'object',
properties: {
id: { type: 'string', description: 'Item ID' },
name: { type: 'string', description: 'Item name' },
},
},
},Only use bare type: 'json' without properties when the shape is truly dynamic or unknown.
If the response shape is unknown because the docs do not provide it, you MUST tell the user and stop. Unknown is not the same as dynamic. Never guess outputs.
ALWAYS use ?? null for fields that may be undefined:
transformResponse: async (response: Response) => {
const data = await response.json()
return {
success: true,
output: {
id: data.id,
title: data.title,
body: data.body ?? null, // May be undefined
assignee: data.assignee ?? null, // May be undefined
labels: data.labels ?? [], // Default to empty array
closedAt: data.closed_at ?? null, // May be undefined
},
}
}DON'T do this:
output: {
data: data, // BAD - raw JSON dump
}DO this instead - extract meaningful fields:
output: {
id: data.id,
name: data.name,
status: data.status,
metadata: {
createdAt: data.created_at,
updatedAt: data.updated_at,
},
}Create types.ts with interfaces for all params and responses:
import type { ToolResponse } from '@/tools/types'
// Parameter interfaces
export interface {Service}{Action}Params {
accessToken: string
requiredField: string
optionalField?: string
}
// Response interfaces (extend ToolResponse)
export interface {Service}{Action}Response extends ToolResponse {
output: {
field1: string
field2: number
optionalField?: string | null
}
}// Export all tools
export { serviceTool1 } from './{action1}'
export { serviceTool2 } from './{action2}'
// Export types
export * from './types'After creating tools:
apps/sim/tools/registry.tstools object with snake_case keys (alphabetically):import { serviceActionTool } from '@/tools/{service}'
export const tools = {
// ... existing tools ...
{service}_{action}: serviceActionTool,
}After registering in tools/registry.ts, you MUST also update the block definition at apps/sim/blocks/blocks/{service}.ts. This is not optional — tools are only usable from the UI if they are wired into the block.
tools.accesstools: {
access: [
// existing tools...
'service_new_action', // Add every new tool ID here
],
config: { ... }
}If the block uses an operation dropdown, add an option for each new tool:
{
id: 'operation',
type: 'dropdown',
options: [
// existing options...
{ label: 'New Action', id: 'new_action' }, // id maps to what tools.config.tool returns
],
}For each new tool, add subBlocks covering all its required params (and optional ones where useful). Apply condition to show them only for the right operation, and mark required params with required:
// Required param for new_action
{
id: 'someParam',
title: 'Some Param',
type: 'short-input',
placeholder: 'e.g., value',
condition: { field: 'operation', value: 'new_action' },
required: { field: 'operation', value: 'new_action' },
},
// Optional param — put in advanced mode
{
id: 'optionalParam',
title: 'Optional Param',
type: 'short-input',
condition: { field: 'operation', value: 'new_action' },
mode: 'advanced',
},tools.config.toolEnsure the tool selector returns the correct tool ID for every new operation. The simplest pattern:
tool: (params) => `service_${params.operation}`,
// If operation dropdown IDs already match tool IDs, this requires no change.If the dropdown IDs differ from tool IDs, add explicit mappings:
tool: (params) => {
const map: Record<string, string> = {
new_action: 'service_new_action',
// ...
}
return map[params.operation] ?? `service_${params.operation}`
},tools.config.paramsAdd any type coercions needed for new params (runs at execution time, after variable resolution):
params: (params) => {
const result: Record<string, unknown> = {}
if (params.limit != null && params.limit !== '') result.limit = Number(params.limit)
if (params.newParamName) result.toolParamName = params.newParamName // rename if IDs differ
return result
},Add any new fields returned by the new tools to the block outputs:
outputs: {
// existing outputs...
newField: { type: 'string', description: 'Description of new field' },
}Add new subBlock param IDs to the block inputs section:
inputs: {
// existing inputs...
someParam: { type: 'string', description: 'Param description' },
optionalParam: { type: 'string', description: 'Optional param description' },
}tools.accesscondition (only show for the right operation)mode: 'advanced'tools.config.tool returns correct ID for every new operationtools.config.params handles any ID remapping or type coercionsoutputsinputsIf creating V2 tools (API-aligned outputs), use _v2 suffix:
{service}_{action}_v2{action}V2Tool'2.0.0'All tool IDs MUST use snake_case: {service}_{action} (e.g., x_create_tweet, slack_send_message). Never use camelCase or PascalCase for tool IDs.
required: true or required: falsevisibility?? nulloptional: trueexport * from './types')tools/registry.tstools.access, dropdown options, subBlocks, tools.config, outputs, inputsAfter creating all tools, you MUST validate every tool before finishing:
required: truerequired: falsetransformResponse extracts the correct fields from the API responsetypes.ts match all tools that use them6f514c1
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.