Skip to content

Commit 7057571

Browse files
committed
Fixed bug where full tool list not passed to LLM. Better debug output.
1 parent 2ad22ff commit 7057571

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

src/commands/evals/providers/anthropic-provider.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,10 @@ export class AnthropicProvider extends LlmProvider {
2323
const toolsResponse = await mcpClient.sdk.listTools();
2424
const mcpTools = toolsResponse.tools || [];
2525

26-
// Filter tools based on allowed list if specified
27-
let toolsToUse = mcpTools;
28-
if (config.allowedTools !== undefined) {
29-
toolsToUse = mcpTools.filter((tool: { name: string }) =>
30-
config.allowedTools!.includes(tool.name)
31-
);
32-
}
33-
3426
// Convert MCP tools to AI SDK format using tool() helper
3527
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3628
const aiTools: Record<string, any> = {};
37-
for (const mcpTool of toolsToUse) {
29+
for (const mcpTool of mcpTools) {
3830
aiTools[mcpTool.name] = tool({
3931
description: mcpTool.description,
4032
parameters: jsonSchema(mcpTool.inputSchema as object),

src/shared/display/utils/conversationFormatter.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ export function formatContent(content: any): string[] {
109109
* Format tool call
110110
*/
111111
export function formatToolCall(toolName: string, args: any): string {
112-
const argsStr = JSON.stringify(args);
112+
const argsStr = JSON.stringify(args, null, 2);
113113
return formatText(`🔧 Tool Call: ${toolName}(${argsStr})`);
114114
}
115115

116116
/**
117117
* Format tool result
118118
*/
119119
export function formatToolResult(result: any): string {
120-
const resultStr = JSON.stringify(result);
121-
const truncated = resultStr.length > 200 ? `${resultStr.substring(0, 200)}...` : resultStr;
122-
return formatText(`✅ Tool Result: ${truncated}`);
120+
return formatText(
121+
`✅ Tool Result: ${JSON.stringify(result.structuredContent ?? result.content, null, 2)}`
122+
);
123123
}

0 commit comments

Comments
 (0)