> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://platform.bctrl.ai/llms.txt.
> For full documentation content, see https://platform.bctrl.ai/llms-full.txt.

# Tools & Toolsets

> Reusable capabilities for hosted invocations.

Tools describe callable capabilities that hosted agents can use. Toolsets group tools and built-ins so an invocation receives the right capability set.

Use tools and toolsets with invocations. They are not needed when you connect an external CDP client such as Playwright or Puppeteer.

## Create a tool

```ts
const tool = await space.tools.create({
  name: "lookup_customer",
  description: "Look up a customer record by email.",
  inputSchema: {
    type: "object",
    properties: {
      email: { type: "string" },
    },
    required: ["email"],
  },
  outputSchema: {
    type: "object",
    properties: {
      customerId: { type: "string" },
    },
  },
  execution: {
    type: "webhook",
    url: "https://example.com/tools/lookup-customer",
    auth: { type: "none" },
  },
});
```

## Create a toolset

```ts
const toolset = await space.toolsets.create({
  name: "crm-tools",
  customToolIds: [tool.id],
  builtin: {
    storage: true,
    artifacts: true,
  },
});
```

## Use a toolset in an invocation

```ts
await runtime.invocations.create({
  provider: "stagehand",
  operation: "agent.execute",
  toolsetId: toolset.id,
  input: {
    instruction: "Find the account owner for acme@example.com.",
  },
});
```

## Inspect tool calls

```ts
const { toolCalls } = await space.toolCalls.list({
  toolId: tool.id,
  limit: 20,
});
```

## Related

* [Invocations](/sdk/core-concepts/invocations)
* [API Reference: Tools](/api/api-reference/tools/list)
* [API Reference: Tool Calls](/api/api-reference/tool-calls/list)