11import { describe , it , expect } from 'vitest' ;
22import { withTrace } from '../src/tracing' ;
33import { NodeMCPServerStdio } from '../src/shims/mcp-server/node' ;
4- import { createStaticToolFilter } from '../src/mcpUtil' ;
4+ import { createMCPToolStaticFilter } from '../src/mcpUtil' ;
55import { Agent } from '../src/agent' ;
66import { RunContext } from '../src/runContext' ;
77
@@ -49,7 +49,7 @@ describe('MCP tool filtering', () => {
4949 const server = new StubServer (
5050 's' ,
5151 tools ,
52- createStaticToolFilter ( { allowed : [ 'a' ] , blocked : [ 'b' ] } ) ,
52+ createMCPToolStaticFilter ( { allowed : [ 'a' ] , blocked : [ 'b' ] } ) ,
5353 ) ;
5454 const agent = new Agent ( {
5555 name : 'agent' ,
@@ -144,7 +144,7 @@ describe('MCP tool filtering', () => {
144144 const serverA = new StubServer (
145145 'A' ,
146146 toolsA ,
147- createStaticToolFilter ( { allowed : [ 'a1' ] } ) ,
147+ createMCPToolStaticFilter ( { allowed : [ 'a1' ] } ) ,
148148 ) ;
149149 const serverB = new StubServer ( 'B' , toolsB ) ;
150150 const agent = new Agent ( {
@@ -180,7 +180,7 @@ describe('MCP tool filtering', () => {
180180 const server = new StubServer (
181181 'cache' ,
182182 tools ,
183- createStaticToolFilter ( { allowed : [ 'x' ] } ) ,
183+ createMCPToolStaticFilter ( { allowed : [ 'x' ] } ) ,
184184 ) ;
185185 const agent = new Agent ( {
186186 name : 'agent' ,
@@ -193,7 +193,9 @@ describe('MCP tool filtering', () => {
193193 const runContext = new RunContext ( ) ;
194194 let result = await server . listTools ( runContext , agent ) ;
195195 expect ( result . map ( ( t ) => t . name ) ) . toEqual ( [ 'x' ] ) ;
196- ( server as any ) . toolFilter = createStaticToolFilter ( { allowed : [ 'y' ] } ) ;
196+ ( server as any ) . toolFilter = createMCPToolStaticFilter ( {
197+ allowed : [ 'y' ] ,
198+ } ) ;
197199 result = await server . listTools ( runContext , agent ) ;
198200 expect ( result . map ( ( t ) => t . name ) ) . toEqual ( [ 'x' ] ) ;
199201 } ) ;
0 commit comments