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.

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.

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"
    }
  }'
{
  "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.

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.

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" }
      ]
    }
  }'
{
  "id": "agt_xyz789",
  "tools": {
    "items": [
      { "tool_id": "tool_8f3kq2" }
    ]
  }
}

Start a session with this agent (see the Agent Session Quickstart) and ask "What's the weather in Tokyo?" — the LLM will call your tool and use the result in its reply.

Calling an endpoint that needs an API key? See Authorization Options to attach a secret to the tool.


Did this page help you?