You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the sampleLLM function within @modelcontextprotocol/server-everything, the result returned by the client is directly inserted into the text.
However, according to the official definition, this result should be an object, such as:
{model: string,// Name of the model usedstopReason?: "endTurn"|"stopSequence"|"maxTokens"|string,role: "user"|"assistant",content: {type: "text"|"image",text?: string,data?: string,mimeType?: string}}
As a consequence, the final content returned will display as [object Object] instead of the actual content of the object.
To Reproduce
Steps to reproduce the behavior:
Initialize a Client
Defining a request handler for the client such as:
client.setRequestHandler(CreateMessageRequestSchema,async(request)=>{console.log(request)return{model: "test-sampling-model",stopReason: "endTurn",role: "assistant",content: {type: "text",text: "This is the test message from client which use as sampling LLM",}};});
Trigger call tool of sampleLLM
Expected behavior
After the server retrieves the result, it should extract and insert the necessary content, rather than embedding the entire result object into the string.
Describe the bug
servers/src/everything/everything.ts
Lines 400 to 406 in 926d86c
In the sampleLLM function within @modelcontextprotocol/server-everything, the result returned by the client is directly inserted into the text.
However, according to the official definition, this result should be an object, such as:
As a consequence, the final content returned will display as [object Object] instead of the actual content of the object.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
After the server retrieves the result, it should extract and insert the necessary content, rather than embedding the entire result object into the string.
Logs
Console log:
Additional context
Examples of feasible fix proposals:
Proposal 1
Proposal 2
If you confirm that this is an issue and agree with the proposed fix, I can submit a PR.
Alternatively, feel free to share any other suggestions or perspectives you might have.
The text was updated successfully, but these errors were encountered: