---
updatedAt: 2026-07-29T08:25:42.000Z
agentTools:
  projectIndex: https://docs.d-id.com/llms.txt
---

# Quickstart

Create a server tool, attach it to an agent, and let the LLM call it

Create a server tool that calls a public endpoint, attach it to an existing agent, and have the agent call it in a session.

<CoolSteps name="tools-quickstart">
  <CoolStep number={1} title="Create the tool">
    Define a server tool with a JSON Schema that tells the LLM what arguments to send. The `description` is what the LLM reads when deciding whether to call the tool.

    ```yaml Request
    curl -X POST "https://api.d-id.com/tools" \
      -H "Authorization: Basic <YOUR KEY>" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "get_current_weather",
        "description": "Get the current weather for a city. Use this when the user asks about weather, temperature, or conditions in a specific location.",
        "provider": "Weather API",
        "schema": {
          "parameters": {
            "type": "object",
            "properties": {
              "city": {
                "type": "string",
                "description": "City name, e.g. \"San Francisco\""
              }
            },
            "required": ["city"]
          }
        },
        "config": {
          "type": "server",
          "url": "https://api.weatherapi.example.com/current",
          "method": "GET"
        }
      }'
    ```

    ```json Response
    {
      "id": "tool_8f3kq2",
      "name": "get_current_weather",
      "provider": "Weather API",
      "config": {
        "type": "server",
        "url": "https://api.weatherapi.example.com/current",
        "method": "GET"
      },
      "created_at": "2026-05-20T12:00:00.000Z"
    }
    ```

    Save the `id` — you'll attach it to an agent in the next step.
  </CoolStep>

  <CoolStep number={2} title="Attach the tool to an agent">
    Add the tool to an existing agent. From this point on, every session with this agent has access to the tool.

    ```yaml Request
    curl -X PATCH "https://api.d-id.com/agents/agt_xyz789" \
      -H "Authorization: Basic <YOUR KEY>" \
      -H "Content-Type: application/json" \
      -d '{
        "tools": {
          "items": [
            { "tool_id": "tool_8f3kq2" }
          ]
        }
      }'
    ```

    ```json Response
    {
      "id": "agt_xyz789",
      "tools": {
        "items": [
          { "tool_id": "tool_8f3kq2" }
        ]
      }
    }
    ```

    Start a session with this agent (see the [Agent Session Quickstart](https://docs.d-id.com/docs/agent-session-quickstart)) and ask "What's the weather in Tokyo?" — the LLM will call your tool and use the result in its reply.
  </CoolStep>
</CoolSteps>

Calling an endpoint that needs an API key? See [Authorization Options](https://docs.d-id.com/docs/authorization-options) to attach a secret to the tool.