Plugin SDK

Tool Definitions

Define tools that agents can discover and use.

Tool Structure

Each tool has a name, description, parameter schema (JSON Schema), and handler function. Tools are discovered by agents through the capability registry.

{ name: "search_docs", description: "Search documentation", parameters: { query: { type: "string", description: "Search query" } }, handler: async (args) => { /* implementation */ } }

Best Practices

  • Use clear, descriptive names (snake_case)
  • Provide detailed parameter descriptions — agents use these to understand how to call the tool
  • Handle errors gracefully with meaningful error messages
  • Keep handlers focused — one tool, one responsibility

See Examples for complete tool implementations.