File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed
Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Original file line number Diff line number Diff 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 ) ,
Original file line number Diff line number Diff line change @@ -109,15 +109,15 @@ export function formatContent(content: any): string[] {
109109 * Format tool call
110110 */
111111export 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 */
119119export 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}
You can’t perform that action at this time.
0 commit comments