---
title: "Get objective context diagnostics"
method: GET
path: "/v1/workspaces/{workspaceId}/objectives/{objectiveId}/diagnostics"
tags: ["ObjectiveService", "Objectives"]
---

# Get objective context diagnostics

`GET /v1/workspaces/{workspaceId}/objectives/{objectiveId}/diagnostics`

Returns the context-usage breakdown measured for the objective's most recent iteration: character lengths per context component (system prompt, memory appendices, tool definitions, messages by role) alongside the iteration's input token counts.

## Path parameters

- `workspaceId` string, required
- `objectiveId` string, required

## Response `200`

OK

- GetObjectiveDiagnosticsResponse
  - `diagnostics` ObjectiveDiagnostics, required — ObjectiveDiagnostics is the context-usage breakdown measured for a single iteration at request-assembly time. It reports how much of the context window each component occupies so tool parameters, memory cascades, and prompts can be tuned against real token usage.
    - `contextLengths` ContextLengths, required — ContextLengths is the measured character length of each distinct component of an iteration's assembled context window. Values are raw character lengths of the component as assembled into the request — token estimates are derived by the client against input_tokens (component share = component length / sum of all lengths). New components are added as new fields — wire-compatible; absent components read as 0.
      - `systemPrompt` integer, required — Character length of the objective's base system prompt (rendered variation template). Not tokens -- see the message comment.
      - `skillsMemory` integer, required — Character length of the skills memory appendix attached to the system prompt.
      - `episodicMemory` integer, required — Character length of the episodic memory appendix attached to the system prompt.
      - `availableTools` integer, required — Character length of the discoverable/available-tools appendix attached to the system prompt.
      - `toolDefinitions` integer, required — Character length of the serialized tool definitions sent with the completion request (names, descriptions, and JSON-schema parameters).
      - `userMessages` integer, required — Character length of the chat history messages with the user role.
      - `assistantMessages` integer, required — Character length of the chat history messages with the assistant role.
      - `toolResults` integer, required — Character length of the tool results present in the chat history.
    - `inputTokens` integer, required — Input tokens reported by the LLM provider for the iteration's completion.
    - `cachedInputTokens` integer, required — The portion of input_tokens served from the provider's prompt cache. Lets clients distinguish "big but cached" from "big and paid fresh every iteration".

## Other responses

- `default` — Default error response

## Changes

- **2026-07-05** `dafd0bd8efa0` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/cadenya/apis/cadenya-api/changes/v1/workspaces/:workspaceId/objectives/:objectiveId/diagnostics/get.md)

---

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