@@ -3,18 +3,19 @@ import type { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/cl
33import { ToolListChangedNotificationSchema } from '@modelcontextprotocol/sdk/types.js' ;
44import { afterAll , afterEach , beforeAll , beforeEach , describe , expect , it } from 'vitest' ;
55
6- import { defaults , HelperTools } from '../../src/const.js' ;
6+ import { ADVANCED_INPUT_KEY , defaults , HelperTools } from '../../src/const.js' ;
7+ import type { McpOptions } from '../../src/input.js' ;
78import { latestNewsOnTopicPrompt } from '../../src/prompts/latest-news-on-topic.js' ;
89import { addRemoveTools , defaultTools , toolCategories , toolCategoriesEnabledByDefault } from '../../src/tools/index.js' ;
910import { actorNameToToolName } from '../../src/tools/utils.js' ;
1011import type { ToolCategory } from '../../src/types.js' ;
1112import { ACTOR_MCP_SERVER_ACTOR_NAME , ACTOR_PYTHON_EXAMPLE , DEFAULT_ACTOR_NAMES , DEFAULT_TOOL_NAMES } from '../const.js' ;
12- import { addActor , type McpClientOptions } from '../helpers.js' ;
13+ import { addActor } from '../helpers.js' ;
1314
1415interface IntegrationTestsSuiteOptions {
1516 suiteName : string ;
1617 transport : 'sse' | 'streamable-http' | 'stdio' ;
17- createClientFn : ( options ?: McpClientOptions ) => Promise < Client > ;
18+ createClientFn : ( options ?: Partial < McpOptions > ) => Promise < Client > ;
1819 beforeAllFn ?: ( ) => Promise < void > ;
1920 afterAllFn ?: ( ) => Promise < void > ;
2021 beforeEachFn ?: ( ) => Promise < void > ;
@@ -273,7 +274,7 @@ export function createIntegrationTestsSuite(
273274 limit : 5 ,
274275 } ,
275276 } ) ;
276- const content = result . content as { text : string } [ ] ;
277+ const content = result . content as { text : string } [ ] ;
277278 expect ( content . some ( ( item ) => item . text . includes ( ACTOR_PYTHON_EXAMPLE ) ) ) . toBe ( true ) ;
278279
279280 await client . close ( ) ;
@@ -292,7 +293,7 @@ export function createIntegrationTestsSuite(
292293 limit : 100 ,
293294 } ,
294295 } ) ;
295- const content = result . content as { text : string } [ ] ;
296+ const content = result . content as { text : string } [ ] ;
296297 expect ( content . length ) . toBe ( 1 ) ;
297298 const outputText = content [ 0 ] . text ;
298299
@@ -485,6 +486,37 @@ export function createIntegrationTestsSuite(
485486 await client . close ( ) ;
486487 } ) ;
487488
489+ it ( `should make ${ ADVANCED_INPUT_KEY } in Actor properties available` , async ( ) => {
490+ const client = await createClientFn ( { enableAddingActors : true , fullActorSchema : true } ) ;
491+ await client . callTool ( { name : HelperTools . ACTOR_ADD , arguments : { actor : 'compass/crawler-google-places' } } ) ;
492+ // Get input type for actor 'compass-slash-crawler-google-places'
493+ const tools = await client . listTools ( ) ;
494+ const googlePlacesTool = tools . tools . find ( ( tool ) => tool . name === 'compass-slash-crawler-google-places' ) ;
495+ const properties = googlePlacesTool ! . inputSchema . properties as Record < string , unknown > ;
496+ expect ( Object . keys ( properties ) ) . toMatchInlineSnapshot ( `
497+ [
498+ "searchStringsArray",
499+ "locationQuery",
500+ "maxCrawledPlacesPerSearch",
501+ "language",
502+ "advancedInput",
503+ ]
504+ ` ) ;
505+ expect ( Object . keys ( ( properties [ ADVANCED_INPUT_KEY ] as { properties : Record < string , unknown > } ) . properties ) . length ) . toBeGreaterThan ( 0 ) ;
506+
507+ await client . close ( ) ;
508+ } ) ;
509+
510+ it ( `should not create ${ ADVANCED_INPUT_KEY } if is disabled` , async ( ) => {
511+ const client = await createClientFn ( { enableAddingActors : true , fullActorSchema : false } ) ;
512+ await client . callTool ( { name : HelperTools . ACTOR_ADD , arguments : { actor : 'compass/crawler-google-places' } } ) ;
513+ const tools = await client . listTools ( ) ;
514+ const googlePlacesTool = tools . tools . find ( ( tool ) => tool . name === 'compass-slash-crawler-google-places' ) ;
515+ const properties = googlePlacesTool ! . inputSchema . properties as Record < string , unknown > ;
516+ expect ( Object . keys ( properties ) ) . not . toContain ( ADVANCED_INPUT_KEY ) ;
517+ await client . close ( ) ;
518+ } ) ;
519+
488520 // Session termination is only possible for streamable HTTP transport.
489521 it . runIf ( options . transport === 'streamable-http' ) ( 'should successfully terminate streamable session' , async ( ) => {
490522 const client = await createClientFn ( ) ;
0 commit comments