add-tools
Skill1 starsChanged 2 months agoApache-2.0View on GitHub
Create tool configurations for a Sim integration by reading API docs
We split this skill into the rules it gives an agent
45 rules. About 0 are common, 28 are distinctive, and 17 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈28
Distinctive · estimate
This author's own choices. Worth a look.
17
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
When the user asks you to create tools for a service:
- Distinctive: line 14
Use Context7 or WebFetch to read the service's API documentation
- Distinctive: line 15
Create the tools directory structure
- Distinctive: line 20
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 …
- Distinctive: line 22
Do NOT invent response field names
- Distinctive: line 23
Do NOT infer nested paths from nearby endpoints
- Distinctive: line 24
Do NOT guess array item shapes
- Very specific: line 25
Do NOT write transformResponse against unverified payloads
- Distinctive: line 27
If the response shape is unknown, do one of these instead:
- Distinctive: line 28
Ask the user for sample responses
- Distinctive: line 29
Ask the user for test credentials so you can verify live responses
- Distinctive: line 31
Leave the tool unimplemented and explicitly say why
- Very specific: line 35
Create files in apps/sim/tools/{service}/:
- Distinctive: line 45
Every tool MUST follow this exact structure:
- Very specific: line 145
Always explicitly set required: true or required: false
- Distinctive: line 150
Leave ordinary external API inputs and third-party results unchanged.
- Distinctive: line 153
Treat URLs, domains, resource IDs, and control fields as ordinary request values unless the exact field is proven model-visible.
- Distinctive: line 163
Never substitute secret plaintext into source, serialize plaintext provenance, hand-roll private headers, or blanket-sanitize tool results.
- Distinctive: line 165
Add focused tests for named projection, identical unproven public text, malformed/incomplete metadata, metadata stripping, scope isolation, …
- Very specific: line 177
Add optional: true for fields that may not exist in the response:
- Very specific: line 188
When using type: 'json' and you know the object shape in advance, always define the inner structure using properties so downstream …
- Very specific: line 224
Only use bare type: 'json' without properties when the shape is truly dynamic or unknown.
- Distinctive: line 226
If the response shape is unknown because the docs do not provide it, you MUST tell the user and stop.
- Very specific: line 231
ALWAYS use ?? null for fields that may be undefined:
- Distinctive: line 250
DON'T do this:
- Distinctive: line 257
DO this instead - extract meaningful fields:
- Very specific: line 272
Create types.ts with interfaces for all params and responses:
- Very specific: line 308
Import tools in apps/sim/tools/registry.ts
- Very specific: line 309
Add to the tools object with snake_case keys (alphabetically):
- Very specific: line 332
After registering in tools/registry.ts, you MUST also update the block definition at apps/sim/blocks/blocks/{service}.ts.
- Distinctive: line 348
If the block uses an operation dropdown, add an option for each new tool:
- Distinctive: line 387
Ensure the tool selector returns the correct tool ID for every new operation.
- Distinctive: line 394
If the dropdown IDs differ from tool IDs, add explicit mappings:
- Distinctive: line 408
Add any type coercions needed for new params (runs at execution time, after variable resolution):
- Very specific: line 421
Add any new fields returned by the new tools to the block outputs:
- Very specific: line 432
Add new subBlock param IDs to the block inputs section:
- Very specific: line 456
If creating V2 tools (API-aligned outputs), use _v2 suffix:
- Very specific: line 464
All tool IDs MUST use snake_case: {service}_{action} (e.g., x_create_tweet, slack_send_message).
- Distinctive: line 488
After creating all tools, you MUST validate every tool before finishing:
- Very specific: line 492
All required params are marked required: true
- Very specific: line 493
All optional params are marked required: false
- Distinctive: line 497
All output fields match what the API actually returns
- Distinctive: line 498
No fields are missing from outputs that the API provides
- Distinctive: line 499
No extra fields are defined in outputs that the API doesn't return
- Distinctive: line 500
Every output field and JSON path is backed by docs or live-verified sample responses
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add Tools Skill
You are an expert at creating tool configurations for Sim integrations. Your job is to read API documentation and create properly structured tool files.
Your Task
When the user asks you to create tools for a service:
- Use Context7 or WebFetch to read the service's API documentation
- Create the tools directory structure
- Generate properly typed tool configurations
Hard Rule: No Guessed Response Schemas
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.
- Do NOT invent response field names
- Do NOT infer nested paths from nearby endpoints
- Do NOT guess array item shapes
- Do NOT write
transformResponseagainst unverified payloads
If the response shape is unknown, do one of these instead:
- Ask the user for sample responses
- Ask the user for test credentials so you can verify live responses
- Implement only the endpoints whose outputs are documented
- Leave the tool unimplemented and explicitly say why
Directory Structure
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)Tool Configuration Structure
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
},
}Critical Rules for Parameters
Visibility Options
'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)
Parameter Types
'string'- Text values'number'- Numeric values'boolean'- True/false'json'- Complex objects (NOT 'object', use 'json')'file'- Single file'file[]'- Multiple files
Required vs Optional
- Always explicitly set
required: trueorrequired: false - Optional params should have
required: false
Resolved Secrets and Provenance Boundaries
- Leave ordinary external API inputs and third-party results unchanged. Add provenance handling only when an exact field is proven to cross a Sim model, durable-storage, or internal-execution boundary.
- Project AI-consumed text/structured fields with the smallest exact
request.modelInputselector. - Treat URLs, domains, resource IDs, and control fields as ordinary request values unless the exact
field is proven model-visible. For serialized external model content, project the serialized
top-level param through
request.modelInputbefore the existing formatter parses it; do not add a separate hard-rejection mechanism. - For authenticated internal routes, use
privateProvenancefor actual inline/raw model bytes orrequest.secretProvenancefor durable writes and execution handoffs. Do not treat a storage key, path, signed URL, or remote URL as provenance for fetched bytes; authorize tracked stored bytes at the owning model-egress boundary. Authenticate first, validate the exact selection and scope, strip the private envelope, then import or propagate provenance at the receiving boundary. Preserve documented headerless legacy behavior. - Never substitute secret plaintext into source, serialize plaintext provenance, hand-roll private headers, or blanket-sanitize tool results.
- Add focused tests for named projection, identical unproven public text, malformed/incomplete metadata, metadata stripping, scope isolation, and legacy compatibility where applicable.
Critical Rules for Outputs
Output Types
'string','number','boolean'- Primitives'json'- Complex objects (use this, NOT 'object')'array'- Arrays withitemsproperty'object'- Objects withpropertiesproperty
Optional Outputs
Add optional: true for fields that may not exist in the response:
closedAt: {
type: 'string',
description: 'When the issue was closed',
optional: true,
},Typed JSON Outputs
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.
Critical Rules for transformResponse
Handle Nullable Fields
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
},
}
}Never Output Raw JSON Dumps
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,
},
}Types File Pattern
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
}
}Index.ts Barrel Export Pattern
// Export all tools
export { serviceTool1 } from './{action1}'
export { serviceTool2 } from './{action2}'
// Export types
export * from './types'Registering Tools
After creating tools:
- Import tools in
apps/sim/tools/registry.ts - Add to the
toolsobject with snake_case keys (alphabetically):
import { serviceActionTool } from '@/tools/{service}'
export const tools = {
// ... existing tools ...
{service}_{action}: serviceActionTool,
}- Regenerate the tool metadata artifacts:
bun run tool-metadata:generateClient code reads a tool's params/outputs from generated metadata rather than
importing the registry, so a tool you add, change or remove is invisible to the UI until
these are regenerated — and CI fails on stale artifacts. Commit the result. See
.agents/skills/tool-registry-boundary/SKILL.md.
Wiring Tools into the Block (Required)
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.
1. Add to tools.access
tools: {
access: [
// existing tools...
'service_new_action', // Add every new tool ID here
],
config: { ... }
}2. Add operation dropdown options
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
],
}3. Add subBlocks for new tool params
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',
},4. Update tools.config.tool
Ensure 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}`
},5. Update tools.config.params
Add 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
},6. Add new outputs
Add any new fields returned by the new tools to the block outputs:
outputs: {
// existing outputs...
newField: { type: 'string', description: 'Description of new field' },
}7. Add new inputs
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' },
}Block wiring checklist
- New tool IDs added to
tools.access - Operation dropdown has an option for each new tool
- SubBlocks cover all required params for each new tool
- SubBlocks have correct
condition(only show for the right operation) - Optional/rarely-used params set to
mode: 'advanced' tools.config.toolreturns correct ID for every new operationtools.config.paramshandles any ID remapping or type coercions- New outputs added to block
outputs - New params added to block
inputs
V2 Tool Pattern
If creating V2 tools (API-aligned outputs), use _v2 suffix:
- Tool ID:
{service}_{action}_v2 - Variable name:
{action}V2Tool - Version:
'2.0.0' - Outputs: Flat, API-aligned (no content/metadata wrapper)
Naming Convention
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.
Checklist Before Finishing
- All tool IDs use snake_case
- All params have explicit
required: trueorrequired: false - All params have appropriate
visibility - All nullable response fields use
?? null - All optional outputs have
optional: true - No raw JSON dumps in outputs
- Types file has all interfaces
- Index.ts exports all tools and re-exports types (
export * from './types') - Tools registered in
tools/registry.ts bun run tool-metadata:generaterun and the regenerated artifacts committedbun run scripts/generate-docs.tsrun and the refreshed docs committed — the integration's docs page is rendered from each tool's description, params, and outputs, and CI'sbun run docs:checkfails on stale pages- Block wired:
tools.access, dropdown options, subBlocks,tools.config, outputs, inputs - Model, durable-storage, and internal-execution boundaries use the shared provenance mechanisms
only where a concrete Sim
{{...}}resolution path requires them - Ordinary third-party inputs/results remain unchanged and private metadata never leaves Sim
Final Validation (Required)
After creating all tools, you MUST validate every tool before finishing:
- Read every tool file you created — do not skip any
- Cross-reference with the API docs to verify:
- All required params are marked
required: true - All optional params are marked
required: false - Param types match the API (string, number, boolean, json)
- Request URL, method, headers, and body match the API spec
transformResponseextracts the correct fields from the API response- All output fields match what the API actually returns
- No fields are missing from outputs that the API provides
- No extra fields are defined in outputs that the API doesn't return
- Every output field and JSON path is backed by docs or live-verified sample responses
- All required params are marked
- Verify consistency across tools:
- Shared types in
types.tsmatch all tools that use them - Tool IDs in the barrel export match the tool file definitions
- Error handling is consistent (error checks, meaningful messages)
- Shared types in
- If any response schema is still unknown, explicitly tell the user instead of guessing
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- simstudioai/sim★ 30k38% same
Wrote their own version · 1
- databricks/app-templates★ 217same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository54 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/constitution.mdcCursor rule
- .cursor/rules/emcn-components.mdcCursor rule
- .cursor/rules/global.mdcCursor rule
- .cursor/rules/landing-seo-geo.mdcCursor rule
- .cursor/rules/sim-architecture.mdcCursor rule
- .cursor/rules/sim-components.mdcCursor rule
- .cursor/rules/sim-hooks.mdcCursor rule
- .cursor/rules/sim-imports.mdcCursor rule
- .cursor/rules/sim-integrations.mdcCursor rule
- .cursor/rules/sim-queries.mdcCursor rule
- .cursor/rules/sim-sandbox.mdcCursor rule
- .cursor/rules/sim-stores.mdcCursor rule
- .cursor/rules/sim-styling.mdcCursor rule
- .cursor/rules/sim-testing.mdcCursor rule
- .cursor/rules/sim-typescript.mdcCursor rule
- .cursor/rules/sim-ui-copy.mdcCursor rule
- add-block-previewSkill
- add-blockSkill
- add-column-typeSkill
- add-connectorSkill
- add-enrichmentSkill
- add-feature-flagSkill
- add-hosted-keySkill
- add-integrationSkill
- add-managed-cliSkill
- add-modelSkill
- add-triggerSkill
- babysitSkill
- cleanupSkill
- councilSkill
- db-migrateSkill
- design-taste-frontendSkill
- emcn-design-reviewSkill
- emil-design-engSkill
- make-interfaces-feel-betterSkill
- memory-load-checkSkill
- migrate-application-operationSkill
- react-query-best-practicesSkill
- shipSkill
- tool-registry-boundarySkill
- v2-api-conventionsSkill
- validate-connectorSkill
- validate-integrationSkill
- validate-modelSkill
- validate-triggerSkill
- you-might-not-need-a-callbackSkill
- you-might-not-need-a-commentSkill
- you-might-not-need-a-memoSkill
- you-might-not-need-an-effectSkill
- you-might-not-need-stateSkill
- you-might-not-need-url-stateSkill
- add-settings-pageSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

