---
title: "Register tools that will be called via WebSocket callbacks"
method: POST
path: "/register/tools"
tags: ["registration"]
---

# Register tools that will be called via WebSocket callbacks

`POST /register/tools`

## Headers

- `x-code-mode-session` string, required

## Request body

- RegisterToolsRequest — Request to register tools
  - `tools` CallbackConfig[], required
    - `description` string, nullable
    - `input_schema` unknown
    - `name` string, required
    - `namespace` string, nullable
    - `output_schema` unknown

## Response `200`

Tools registered successfully

- RegisterToolsResponse — Response to registering tools. `failed` lists tools that could not be registered at all (name clash, unparseable schema); the rest of the batch still registers. A tool whose schema our codegen can't express is registered with a permissive `any` signature and reported in `warnings`, not failed.
  - `failed` FailedCallback[]
    - `id` string, required
    - `reason` string, required
  - `registered` integer, required
  - `warnings` CallbackWarning[] — Tools that registered in a degraded form (e.g. types fell back to `any`).
    - `id` string, required
    - `reason` string, required

## Other responses

- `404` — Session not found
- `500` — Internal server error

---

[API](https://skmtc.dev/portofcontext/apis/pctx-agent-server-api.md) · [All operations](https://skmtc.dev/portofcontext/apis/pctx-agent-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/portofcontext/pctx-agent-server-api/revisions/d1f357cea012/schema)
