> ## 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.

# LogSpanToolContent

> Span content type for tool and function-call executions triggered by an LLM.

# LogSpanToolContent

Span content for tool executions. Use this type when logging tool or function calls that are invoked as part of an agentic workflow — for example, when an LLM requests a `get_weather` function call and your application executes it.

## Import

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

## Type Definition

```typescript theme={null}
interface LogSpanToolContent {
  type: 'Tool';
  input: string;                   // JSON string (must be valid JSON)
  output: string;                  // JSON string (must be valid JSON)
}
```

## Properties

* `type` - Discriminator field, always `'Tool'` for this content type
* `input` - The tool call arguments as a JSON string (`JSON.stringify()` of the parameters)
* `output` - The tool result as a JSON string (`JSON.stringify()` of the return value)

Both `input` and `output` must be valid, parseable JSON strings (the result of `JSON.stringify()`). Passing a plain string that isn't valid JSON will cause the span to be rejected.

***

## Example

```typescript theme={null}
async function getWeather(city: string): Promise<{ temp: number; conditions: string }> {
  const res = await fetch(`https://api.weather.example/v1?city=${city}`);
  return res.json();
}

const toolInput = { function: 'get_weather', arguments: { city: 'San Francisco' } };
const toolOutput = await getWeather(toolInput.arguments.city);

span.update({
  content: {
    type: 'Tool',
    input: JSON.stringify(toolInput),
    output: JSON.stringify(toolOutput),
  },
});
```

***

## Related

* [LogSpanContent](/docs/reference/sdk/v2/typescript/types/LogSpanContent) — union type that includes `LogSpanToolContent`
* [LogSpanFunctionContent](/docs/reference/sdk/v2/typescript/types/LogSpanFunctionContent) — for custom application logic (not LLM-triggered)
* [Span](/docs/reference/sdk/v2/typescript/classes/span) — class that accepts `LogSpanContent` via `span.update()`
