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
- Connect to the everything server
- Call the sampleLLM tool
- 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}` }],
};