tambahannnya
This commit is contained in:
@@ -118,16 +118,16 @@ async function handleMCPRequestAsync(
|
||||
const baseUrl =
|
||||
process.env.BUN_PUBLIC_BASE_URL || "http://localhost:3000";
|
||||
const result = await executeTool(tool, params?.arguments || {}, baseUrl);
|
||||
const isObject = typeof result === "object" && result !== null;
|
||||
|
||||
return {
|
||||
jsonrpc: "2.0",
|
||||
id,
|
||||
result: {
|
||||
content: [
|
||||
{
|
||||
type: "text",
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
isObject
|
||||
? { type: "json", data: result } // prefer JSON jika client support
|
||||
: { type: "text", text: String(result) },
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user