> ## Documentation Index
> Fetch the complete documentation index at: https://www.adaline.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ToolResponseContent

> Tool/function execution response returned to LLM with result data and optional API metadata.

# ToolResponseContent

Tool/function execution response returned to the LLM with result data and optional API metadata.

## Import

```typescript theme={null}
import type { ToolResponseContent } from '@adaline/api';
```

## Type Definition

```typescript theme={null}
interface ToolResponseContent {
  modality: 'tool-response';
  index: number;
  id: string;
  name: string;
  data: string;
  apiResponse?: {
    statusCode?: number;
  } | null;
}
```

## Fields

<ParamField body="modality" type="string" required>
  Must be `"tool-response"`.
</ParamField>

<ParamField body="index" type="number" required>
  Zero-based index matching the tool call. Minimum: 0.
</ParamField>

<ParamField body="id" type="string" required>
  Identifier matching the corresponding tool call `id`.
</ParamField>

<ParamField body="name" type="string" required>
  Name of the function that was called.
</ParamField>

<ParamField body="data" type="string" required>
  JSON-encoded string of the function result.
</ParamField>

<ParamField body="apiResponse" type="{ statusCode?: number } | null" optional>
  Optional API response metadata with HTTP status code.
</ParamField>

***

## Example

```typescript theme={null}
import type { ToolResponseContent, PromptMessage } from '@adaline/api';

const toolResponse: ToolResponseContent = {
  modality: 'tool-response',
  index: 0,
  id: 'call_abc123',
  name: 'get_weather',
  data: JSON.stringify({
    temperature: 72,
    conditions: 'sunny',
    humidity: 65
  }),
  apiResponse: {
    statusCode: 200
  }
};

const message: PromptMessage = {
  role: 'tool',
  content: [toolResponse]
};
```

**JSON**:

```json theme={null}
{
  "modality": "tool-response",
  "index": 0,
  "id": "call_abc123",
  "name": "get_weather",
  "data": "{\"temperature\":72,\"conditions\":\"sunny\",\"humidity\":65}",
  "apiResponse": {
    "statusCode": 200
  }
}
```

***

## Related

* [ToolCallContent](/docs/reference/sdk/v2/typescript/types/ToolCallContent) — the corresponding request that triggers a tool response
* [MessageContent](/docs/reference/sdk/v2/typescript/types/MessageContent) — union type that includes `ToolResponseContent`
* [ToolFunction](/docs/reference/sdk/v2/typescript/types/ToolFunction) — defines the tool schema for function calling
