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