Skip to main content

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

Type Definition

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


  • LogSpanContent — union type that includes LogSpanToolContent
  • LogSpanFunctionContent — for custom application logic (not LLM-triggered)
  • Span — class that accepts LogSpanContent via span.update()