diff --git a/CHANGELOG.md b/CHANGELOG.md index c9bf5b5..cab971f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ - Skip `describe` tool when `per_action_tool` is enabled and the service exposes only actions/functions (no entities) +### Fixed + +- Consider the prefix in the `query` tool description + ## Version 1.4.3 - 2026-08-14 ### Fixed diff --git a/lib/tools/query.js b/lib/tools/query.js index 0491abf..7110086 100644 --- a/lib/tools/query.js +++ b/lib/tools/query.js @@ -52,7 +52,7 @@ function createGenericReadToolDefinition(entityNames, serviceName, prefix = '') if (cds.env.mcp?.format === 'cqn') { return { name, - description: `Query any entity in ${serviceName} service. Use describe to discover available entities and their fields.`, + description: `Query any entity in ${serviceName} service. Use ${prefix}describe to discover available entities and their fields.`, inputSchema: createReadInputSchema({ entityNames }), annotations: { readOnlyHint: true, @@ -64,9 +64,7 @@ function createGenericReadToolDefinition(entityNames, serviceName, prefix = '') return { name, - description: - `Query any entity in ${serviceName} service.` + - "Ensure to first use the `describe` tool to discover an entity's available fields.", + description: `Query any entity in ${serviceName} service. Ensure to first use the ${prefix}describe tool to discover an entity's available fields.`, inputSchema: z.object({ cql: z .string() diff --git a/tests/integration/__snapshots__/catalog-service-card.json b/tests/integration/__snapshots__/catalog-service-card.json index fde2fb5..d6b92c9 100644 --- a/tests/integration/__snapshots__/catalog-service-card.json +++ b/tests/integration/__snapshots__/catalog-service-card.json @@ -18,7 +18,7 @@ "tools": [ { "name": "query", - "description": "Query any entity in CatalogService service.Ensure to first use the `describe` tool to discover an entity's available fields.", + "description": "Query any entity in CatalogService service. Ensure to first use the describe tool to discover an entity's available fields.", "inputSchema": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", diff --git a/tests/integration/prefix.test.js b/tests/integration/prefix.test.js index 78c4369..9138754 100644 --- a/tests/integration/prefix.test.js +++ b/tests/integration/prefix.test.js @@ -44,6 +44,13 @@ describe('Tool Name Prefix (global prefix: true)', () => { expect(content.data.length).to.be.greaterThan(0) }) + it('query tool description considers prefix for describe', async () => { + const response = await mcp('tools/list') + const queryTool = response.result.tools.find((t) => t.name === 'CatalogService-query') + expect(queryTool).to.exist + expect(queryTool.description).to.include('CatalogService-describe') + }) + it('prefixed call tool works', async () => { const { content, error } = await callTool('CatalogService-call', { action: 'sum',