pi-mcp-extension 1.5.3 → 1.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/tool-bridge.ts +3 -2
package/package.json
CHANGED
package/src/tool-bridge.ts
CHANGED
|
@@ -226,7 +226,7 @@ export function buildToolName(prefix: string, serverName: string, toolName: stri
|
|
|
226
226
|
type PiTextContent = { type: "text"; text: string };
|
|
227
227
|
type PiImageContent = { type: "image"; data: string; mimeType: string };
|
|
228
228
|
|
|
229
|
-
function convertMcpContent(items: unknown[]): (PiTextContent | PiImageContent)[] {
|
|
229
|
+
export function convertMcpContent(items: unknown[]): (PiTextContent | PiImageContent)[] {
|
|
230
230
|
return items.map((item: any) => {
|
|
231
231
|
if (!item || typeof item !== "object") {
|
|
232
232
|
return { type: "text", text: String(item) };
|
|
@@ -448,7 +448,8 @@ export class ToolBridge {
|
|
|
448
448
|
// Tool execution errors (isError: true) — distinct from protocol errors
|
|
449
449
|
if (result.isError) {
|
|
450
450
|
const errorText = content
|
|
451
|
-
.
|
|
451
|
+
.filter((c): c is PiTextContent => c.type === "text")
|
|
452
|
+
.map((c) => c.text)
|
|
452
453
|
.join("\n");
|
|
453
454
|
throw new McpError(
|
|
454
455
|
errorText || "Tool reported an error",
|