Skip to content

Tools

UClaw tools are configured through two fields on AgentConfig:

  • extensions: named tools and hooks the runtime can invoke.
  • capabilities: coarse-grained permissions such as reading files, executing code, using network, or accessing secrets.

Server-Side Extensions

Use environment: "agent" or "app" for runtime-executed extensions.

ts
await agent.updateConfig({
  extensions: [
    {
      environment: "agent",
      name: "summarize_input",
      description: "Summarize text for the current agent.",
      parameters: {
        type: "object",
        properties: {
          text: { type: "string" },
        },
        required: ["text"],
      },
      code: `
export default async function ({ text }) {
  return String(text).slice(0, 500);
}
`,
    },
  ],
  capabilities: ["read", "execute"],
});

Capabilities

ts
await agent.updateConfig({
  capabilities: [
    "read",
    "write",
    {
      environment: "agent",
      capabilities: ["execute", "database", "network"],
    },
  ],
});

Stable Shape

New code should use extensions and capabilities for all custom tool configuration.