Skip to content

[everything] The sampleLLM tool echoes the response object, not the sampled text content #483

@PederHP

Description

@PederHP

Describe the bug
The everything server's sampleLLM tool incorrectly converts the sampling response object directly to a string, resulting in "{object Object}" instead of accessing the text content from the response.

To Reproduce

  1. Connect to the everything server
  2. Call the sampleLLM tool
  3. Observe that the response contains "{object Object}" instead of the actual text content

Expected behavior
The server should extract the text content from the sampling response object. Based on the TypeScript SDK's protocol.ts, the response contains the result payload, which should be accessed appropriately before string conversion.

Additional context
The current implementation in everything.ts directly uses the result in a template literal:

return {
  content: [{ type: "text", text: `LLM sampling result: ${result}` }],
};

It should instead access the text content from the response structure:

return {
  content: [{ type: "text", text: `LLM sampling result: ${result.content.text}` }],
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions