Skip to content
This repository was archived by the owner on Aug 5, 2025. It is now read-only.
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

[Vercel AI SDK] Tool output is not properly JSONified #83

@Dam-Buty

Description

@Dam-Buty

In my current setup, i have strongly typed tools (because they are linked to React components in my Gen UI). As such, they don't return JSON strings but plain old Javascript objects.

This is handled neatly in Vercel AI SDK, however the Literal client does not like it and will log the tool results as object Object :

image

Naively it seems to me like the issue stems from this line in the instrumentation :

    for (const toolResult of result.toolResults as any[]) {
      messages.push({
        role: 'tool',
        tool_call_id: toolResult.toolCallId,
        content: String(toolResult.result)
      });
    }

However there might be some other implications that i have overlooked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions