fix: harden assistant authoring and UI

This commit is contained in:
ajnart authored and Thomas Camlong committed 2026-08-09 18:09:11 +02:00
1 parent fa0e55cc93
commit edc7b4d55b
51 files changed
+4118 -916

No files matched your search

+4 -2
View File
@@ -8,7 +8,7 @@ interface CreateMcpProtocolHandlerOptions {
version: string;
instructions: string;
configureServer?: (server: McpServer) => void;
formatToolError: (error: unknown) => string;
formatToolError: (error: unknown, toolName: string) => string;
onToolError?: (toolName: string, error: unknown) => void;
onProtocolError?: (error: Error) => void;
}
@@ -70,7 +70,9 @@ export const createMcpProtocolHandler = ({
} catch (error) {
onToolError?.(tool.name, error);
return {
content: [{ type: "text" as const, text: JSON.stringify({ error: formatToolError(error) }) }],
content: [
{ type: "text" as const, text: JSON.stringify({ error: formatToolError(error, tool.name) }) },
],
isError: true,
};
}