@coldiq/mcp 0.4.7 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +6 -2
- package/dist/client.js.map +1 -1
- package/dist/index.js +37 -41
- package/dist/index.js.map +1 -1
- package/dist/instructions.d.ts +3 -0
- package/dist/instructions.d.ts.map +1 -0
- package/dist/instructions.js +9 -0
- package/dist/instructions.js.map +1 -0
- package/dist/knowledge-policy.d.ts +3 -0
- package/dist/knowledge-policy.d.ts.map +1 -0
- package/dist/knowledge-policy.js +5 -0
- package/dist/knowledge-policy.js.map +1 -0
- package/dist/tools/list-skills.d.ts.map +1 -1
- package/dist/tools/list-skills.js +4 -3
- package/dist/tools/list-skills.js.map +1 -1
- package/dist/tools/load-skill.d.ts.map +1 -1
- package/dist/tools/load-skill.js +2 -1
- package/dist/tools/load-skill.js.map +1 -1
- package/dist/tools/search-knowledge.d.ts +22 -0
- package/dist/tools/search-knowledge.d.ts.map +1 -0
- package/dist/tools/search-knowledge.js +45 -0
- package/dist/tools/search-knowledge.js.map +1 -0
- package/package.json +1 -1
- package/src/client.ts +7 -2
- package/src/index.ts +42 -41
- package/src/instructions.ts +10 -0
- package/src/knowledge-policy.ts +6 -0
- package/src/tools/list-skills.ts +4 -3
- package/src/tools/load-skill.ts +2 -1
- package/src/tools/search-knowledge.ts +50 -0
- package/tests/client.test.ts +14 -0
- package/tests/instructions.test.ts +67 -0
- package/tests/tools/search-knowledge.test.ts +104 -0
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,OAAO,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,OAAO,CAAA;IACb,oFAAoF;IACpF,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAChC,CAAA;AAMD,wBAAgB,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CA0BjE;AAED,wBAAsB,OAAO,CAC3B,MAAM,EAAE,KAAK,GAAG,MAAM,EACtB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,EACd,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACnC,OAAO,CAAC,WAAW,CAAC,CAkEtB"}
|
package/dist/client.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Agent, setGlobalDispatcher } from 'undici';
|
|
2
2
|
import { recordChargeFromHeaders } from './session-usage.js';
|
|
3
|
+
import { readPackageVersion } from './version.js';
|
|
4
|
+
const packageVersion = readPackageVersion(import.meta.url);
|
|
3
5
|
let _apiUrl;
|
|
4
6
|
let _apiKey;
|
|
5
7
|
let _httpTimeoutMs;
|
|
@@ -37,9 +39,11 @@ export async function callApi(method, path, body, queryParams) {
|
|
|
37
39
|
}
|
|
38
40
|
const headers = {
|
|
39
41
|
Authorization: `Bearer ${_apiKey}`,
|
|
40
|
-
// Client-declared surface attribution, persisted on
|
|
41
|
-
// (analytics only — mirrors src/lib/client-surface.ts
|
|
42
|
+
// Client-declared surface + package-version attribution, persisted on
|
|
43
|
+
// marketplace.usage_logs (analytics only — mirrors src/lib/client-surface.ts
|
|
44
|
+
// in the API repo; lets ColdIQ see which MCP versions are in the wild).
|
|
42
45
|
'X-ColdIQ-Client-Surface': 'mcp',
|
|
46
|
+
'X-ColdIQ-Client-Version': packageVersion,
|
|
43
47
|
};
|
|
44
48
|
const init = {
|
|
45
49
|
method,
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAEjD,MAAM,cAAc,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAU1D,IAAI,OAAe,CAAA;AACnB,IAAI,OAAe,CAAA;AACnB,IAAI,cAAsB,CAAA;AAE1B,MAAM,UAAU,UAAU,CAAC,MAAe,EAAE,MAAe;IACzD,OAAO,GAAG,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,wBAAwB,CAAA;IAC1E,OAAO,GAAG,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAA;IACpD,yEAAyE;IACzE,6EAA6E;IAC7E,8EAA8E;IAC9E,6EAA6E;IAC7E,8DAA8D;IAC9D,cAAc,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,QAAQ,EAAE,EAAE,CAAC,CAAA;IAC7E,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAA;IACvG,CAAC;IACD,uBAAuB;IACvB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IAErC,mEAAmE;IACnE,uFAAuF;IACvF,qFAAqF;IACrF,mBAAmB,CACjB,IAAI,KAAK,CAAC;QACR,gBAAgB,EAAE,MAA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AE;SACZ,CAAA;IACH,CAAC;AACH,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
4
|
import { initClient } from './client.js';
|
|
5
|
+
import { MCP_SERVER_INSTRUCTIONS } from './instructions.js';
|
|
6
|
+
import { withKnowledgeFirstRequirement } from './knowledge-policy.js';
|
|
5
7
|
import { readPackageVersion } from './version.js';
|
|
8
|
+
import { searchKnowledgeName, searchKnowledgeDescription, searchKnowledgeSchema, searchKnowledgeHandler, } from './tools/search-knowledge.js';
|
|
6
9
|
import { searchCompaniesName, searchCompaniesDescription, searchCompaniesSchema, searchCompaniesHandler, } from './tools/search-companies.js';
|
|
7
10
|
import { findPeopleName, findPeopleDescription, findPeopleSchema, findPeopleHandler, } from './tools/find-people.js';
|
|
8
11
|
import { findEmailName, findEmailDescription, findEmailSchema, findEmailHandler, } from './tools/find-email.js';
|
|
@@ -51,53 +54,46 @@ const server = new McpServer({
|
|
|
51
54
|
name: 'coldiq',
|
|
52
55
|
version: packageVersion,
|
|
53
56
|
}, {
|
|
54
|
-
|
|
55
|
-
// prospecting flow — the dominant latency driver. Looping these tools
|
|
56
|
-
// per-item multiplies wall-clock with zero quality gain: find_people runs a
|
|
57
|
-
// ~90s async job per call, so N looped calls cost ~N×90s vs ~90s batched.
|
|
58
|
-
instructions: [
|
|
59
|
-
'ColdIQ prospecting tools. Always BATCH, never loop, to keep multi-step prospecting fast:',
|
|
60
|
-
'1. To find people across several companies, make ONE find_people call passing every company in company_linkedin_urls (preferred) or company_domains — never one call per company. Set limit = (results wanted per company) × (number of companies).',
|
|
61
|
-
'2. To find emails for several people, make ONE find_emails call with all of them — never loop find_email per person. find_emails runs providers in parallel and is several times faster.',
|
|
62
|
-
'3. Typical flow: search_companies → find_people (one batched call) → find_emails (one batched call).',
|
|
63
|
-
].join('\n'),
|
|
57
|
+
instructions: MCP_SERVER_INSTRUCTIONS,
|
|
64
58
|
});
|
|
65
|
-
// Register
|
|
66
|
-
|
|
67
|
-
server.tool(
|
|
68
|
-
server.tool(
|
|
69
|
-
server.tool(
|
|
70
|
-
server.tool(
|
|
71
|
-
server.tool(
|
|
72
|
-
server.tool(
|
|
73
|
-
server.tool(
|
|
74
|
-
server.tool(
|
|
75
|
-
server.tool(
|
|
76
|
-
server.tool(
|
|
77
|
-
server.tool(
|
|
78
|
-
server.tool(
|
|
79
|
-
server.tool(
|
|
80
|
-
server.tool(
|
|
81
|
-
server.tool(
|
|
82
|
-
server.tool(
|
|
83
|
-
server.tool(
|
|
84
|
-
server.tool(
|
|
85
|
-
server.tool(
|
|
86
|
-
server.tool(
|
|
87
|
-
server.tool(
|
|
88
|
-
server.tool(
|
|
89
|
-
server.tool(
|
|
59
|
+
// Register knowledge retrieval before every operational tool so clients that
|
|
60
|
+
// preserve registration order surface the mandatory prerequisite first.
|
|
61
|
+
server.tool(searchKnowledgeName, searchKnowledgeDescription, searchKnowledgeSchema, searchKnowledgeHandler);
|
|
62
|
+
server.tool(searchCompaniesName, withKnowledgeFirstRequirement(searchCompaniesDescription), searchCompaniesSchema, searchCompaniesHandler);
|
|
63
|
+
server.tool(findPeopleName, withKnowledgeFirstRequirement(findPeopleDescription), findPeopleSchema, findPeopleHandler);
|
|
64
|
+
server.tool(findEmailName, withKnowledgeFirstRequirement(findEmailDescription), findEmailSchema, findEmailHandler);
|
|
65
|
+
server.tool(enrichPersonName, withKnowledgeFirstRequirement(enrichPersonDescription), enrichPersonSchema, enrichPersonHandler);
|
|
66
|
+
server.tool(findEmailsName, withKnowledgeFirstRequirement(findEmailsDescription), findEmailsSchema, findEmailsHandler);
|
|
67
|
+
server.tool(verifyEmailName, withKnowledgeFirstRequirement(verifyEmailDescription), verifyEmailSchema, verifyEmailHandler);
|
|
68
|
+
server.tool(verifyEmailsBulkName, withKnowledgeFirstRequirement(verifyEmailsBulkDescription), verifyEmailsBulkSchema, verifyEmailsBulkHandler);
|
|
69
|
+
server.tool(findEmailsBulkName, withKnowledgeFirstRequirement(findEmailsBulkDescription), findEmailsBulkSchema, findEmailsBulkHandler);
|
|
70
|
+
server.tool(enrichPersonBulkName, withKnowledgeFirstRequirement(enrichPersonBulkDescription), enrichPersonBulkSchema, enrichPersonBulkHandler);
|
|
71
|
+
server.tool(enrichCompanyBulkName, withKnowledgeFirstRequirement(enrichCompanyBulkDescription), enrichCompanyBulkSchema, enrichCompanyBulkHandler);
|
|
72
|
+
server.tool(findPhoneBulkName, withKnowledgeFirstRequirement(findPhoneBulkDescription), findPhoneBulkSchema, findPhoneBulkHandler);
|
|
73
|
+
server.tool(getBulkJobName, withKnowledgeFirstRequirement(getBulkJobDescription), getBulkJobSchema, getBulkJobHandler);
|
|
74
|
+
server.tool(cancelBulkJobName, withKnowledgeFirstRequirement(cancelBulkJobDescription), cancelBulkJobSchema, cancelBulkJobHandler);
|
|
75
|
+
server.tool(findPhoneName, withKnowledgeFirstRequirement(findPhoneDescription), findPhoneSchema, findPhoneHandler);
|
|
76
|
+
server.tool(enrichCompanyName, withKnowledgeFirstRequirement(enrichCompanyDescription), enrichCompanySchema, enrichCompanyHandler);
|
|
77
|
+
server.tool(searchWebName, withKnowledgeFirstRequirement(searchWebDescription), searchWebSchema, searchWebHandler);
|
|
78
|
+
server.tool(searchJobsName, withKnowledgeFirstRequirement(searchJobsDescription), searchJobsSchema, searchJobsHandler);
|
|
79
|
+
server.tool(searchAdsName, withKnowledgeFirstRequirement(searchAdsDescription), searchAdsSchema, searchAdsHandler);
|
|
80
|
+
server.tool(searchPlacesName, withKnowledgeFirstRequirement(searchPlacesDescription), searchPlacesSchema, searchPlacesHandler);
|
|
81
|
+
server.tool(findInfluencersName, withKnowledgeFirstRequirement(findInfluencersDescription), findInfluencersSchema, findInfluencersHandler);
|
|
82
|
+
server.tool(searchRedditName, withKnowledgeFirstRequirement(searchRedditDescription), searchRedditSchema, searchRedditHandler);
|
|
83
|
+
server.tool(searchSeoName, withKnowledgeFirstRequirement(searchSeoDescription), searchSeoSchema, searchSeoHandler);
|
|
84
|
+
server.tool(findSignalsName, withKnowledgeFirstRequirement(findSignalsDescription), findSignalsSchema, findSignalsHandler);
|
|
85
|
+
server.tool(fetchPageContentName, withKnowledgeFirstRequirement(fetchPageContentDescription), fetchPageContentSchema, fetchPageContentHandler);
|
|
90
86
|
server.tool(getCreditBalanceName, getCreditBalanceDescription, getCreditBalanceSchema, getCreditBalanceHandler);
|
|
91
87
|
server.tool(getSessionUsageName, getSessionUsageDescription, getSessionUsageSchema, getSessionUsageHandler);
|
|
92
|
-
server.tool(listDataSourcesName, listDataSourcesDescription, listDataSourcesSchema, listDataSourcesHandler);
|
|
88
|
+
server.tool(listDataSourcesName, withKnowledgeFirstRequirement(listDataSourcesDescription), listDataSourcesSchema, listDataSourcesHandler);
|
|
93
89
|
server.tool(listSkillsName, listSkillsDescription, listSkillsSchema, listSkillsHandler);
|
|
94
90
|
server.tool(loadSkillName, loadSkillDescription, loadSkillSchema, loadSkillHandler);
|
|
95
|
-
server.tool(extractPostEngagementName, extractPostEngagementDescription, extractPostEngagementSchema, extractPostEngagementHandler);
|
|
96
|
-
server.tool(getPlaceReviewsName, getPlaceReviewsDescription, getPlaceReviewsSchema, getPlaceReviewsHandler);
|
|
91
|
+
server.tool(extractPostEngagementName, withKnowledgeFirstRequirement(extractPostEngagementDescription), extractPostEngagementSchema, extractPostEngagementHandler);
|
|
92
|
+
server.tool(getPlaceReviewsName, withKnowledgeFirstRequirement(getPlaceReviewsDescription), getPlaceReviewsSchema, getPlaceReviewsHandler);
|
|
97
93
|
// Generic endpoint discovery + invoke: reach any integrated provider without a dedicated tool.
|
|
98
|
-
server.tool(searchEndpointsName, searchEndpointsDescription, searchEndpointsSchema, searchEndpointsHandler);
|
|
99
|
-
server.tool(getEndpointDetailsName, getEndpointDetailsDescription, getEndpointDetailsSchema, getEndpointDetailsHandler);
|
|
100
|
-
server.tool(callEndpointName, callEndpointDescription, callEndpointSchema, callEndpointHandler);
|
|
94
|
+
server.tool(searchEndpointsName, withKnowledgeFirstRequirement(searchEndpointsDescription), searchEndpointsSchema, searchEndpointsHandler);
|
|
95
|
+
server.tool(getEndpointDetailsName, withKnowledgeFirstRequirement(getEndpointDetailsDescription), getEndpointDetailsSchema, getEndpointDetailsHandler);
|
|
96
|
+
server.tool(callEndpointName, withKnowledgeFirstRequirement(callEndpointDescription), callEndpointSchema, callEndpointHandler);
|
|
101
97
|
// Connect via stdio transport
|
|
102
98
|
const transport = new StdioServerTransport();
|
|
103
99
|
await server.connect(transport);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC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CAAA;AAC1I,MAAM,CAAC,IAAI,CAAC,sBAAsB,EAAE,6BAA6B,CAAC,6BAA6B,CAAC,EAAE,wBAAwB,EAAE,yBAAyB,CAAC,CAAA;AACtJ,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,6BAA6B,CAAC,uBAAuB,CAAC,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,CAAA;AAE9H,8BAA8B;AAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAA;AAC5C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const MANDATORY_KNOWLEDGE_FIRST_RULE = "For every new substantive GTM task, you MUST call `search_knowledge` as the first ColdIQ tool, before endpoint discovery or data calls. Pass the user\u2019s complete task as the query. Follow the retrieved play and provider order. Do not reuse knowledge from a previous task. If search fails or returns no usable result, continue with endpoint discovery.";
|
|
2
|
+
export declare const MCP_SERVER_INSTRUCTIONS: string;
|
|
3
|
+
//# sourceMappingURL=instructions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,uWACsT,CAAA;AAEjW,eAAO,MAAM,uBAAuB,QAMxB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const MANDATORY_KNOWLEDGE_FIRST_RULE = 'For every new substantive GTM task, you MUST call `search_knowledge` as the first ColdIQ tool, before endpoint discovery or data calls. Pass the user’s complete task as the query. Follow the retrieved play and provider order. Do not reuse knowledge from a previous task. If search fails or returns no usable result, continue with endpoint discovery.';
|
|
2
|
+
export const MCP_SERVER_INSTRUCTIONS = [
|
|
3
|
+
MANDATORY_KNOWLEDGE_FIRST_RULE,
|
|
4
|
+
'',
|
|
5
|
+
'Retrieved knowledge controls the workflow and provider order; do not invent or override them. Prefer batched dedicated tools when they fit, and batch inputs instead of looping. Otherwise use `search_endpoints` → `get_endpoint_details` → `call_endpoint`.',
|
|
6
|
+
'Stop as soon as the requested count and fields are satisfied. Include source/provider attribution and disclose gaps or uncertainty.',
|
|
7
|
+
'`list_skills` and `load_skill` are legacy compatibility tools; prefer knowledge retrieval. Greetings, acknowledgements, balance checks, and other non-GTM administrative requests may skip knowledge search.',
|
|
8
|
+
].join('\n');
|
|
9
|
+
//# sourceMappingURL=instructions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,8BAA8B,GACzC,+VAA+V,CAAA;AAEjW,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,8BAA8B;IAC9B,EAAE;IACF,+PAA+P;IAC/P,qIAAqI;IACrI,8MAA8M;CAC/M,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const KNOWLEDGE_FIRST_REQUIREMENT = "For every new substantive GTM task, call search_knowledge as the first ColdIQ tool and pass the user\u2019s complete task as the query.";
|
|
2
|
+
export declare function withKnowledgeFirstRequirement(description: string): string;
|
|
3
|
+
//# sourceMappingURL=knowledge-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-policy.d.ts","sourceRoot":"","sources":["../src/knowledge-policy.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,4IAC8F,CAAA;AAEtI,wBAAgB,6BAA6B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEzE"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export const KNOWLEDGE_FIRST_REQUIREMENT = 'For every new substantive GTM task, call search_knowledge as the first ColdIQ tool and pass the user’s complete task as the query.';
|
|
2
|
+
export function withKnowledgeFirstRequirement(description) {
|
|
3
|
+
return `${KNOWLEDGE_FIRST_REQUIREMENT} ${description}`;
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=knowledge-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-policy.js","sourceRoot":"","sources":["../src/knowledge-policy.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GACtC,oIAAoI,CAAA;AAEtI,MAAM,UAAU,6BAA6B,CAAC,WAAmB;IAC/D,OAAO,GAAG,2BAA2B,IAAI,WAAW,EAAE,CAAA;AACxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-skills.d.ts","sourceRoot":"","sources":["../../src/tools/list-skills.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,gBAAgB,CAAA;AAE3C,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"list-skills.d.ts","sourceRoot":"","sources":["../../src/tools/list-skills.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,gBAAgB,CAAA;AAE3C,eAAO,MAAM,qBAAqB,QAOkE,CAAA;AAEpG,eAAO,MAAM,gBAAgB,IAAK,CAAA;AAElC,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;GAUtE"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { listSkills } from '../skills.js';
|
|
2
2
|
export const listSkillsName = 'list_skills';
|
|
3
|
-
export const listSkillsDescription = '
|
|
3
|
+
export const listSkillsDescription = 'Legacy compatibility tool. Prefer search_knowledge for each new substantive GTM task because it returns the ' +
|
|
4
|
+
'current ranked workflow and provider order. Lists the available ColdIQ GTM playbooks ("skills") — ' +
|
|
5
|
+
'step-by-step expert workflows for go-to-market ' +
|
|
4
6
|
'tasks: building a TAM, Apollo / company / people search, contact enrichment and email waterfalls, ' +
|
|
5
7
|
'signal detection, ICP & personas, cold-email copy, campaign delivery, and more. Returns each skill\'s ' +
|
|
6
|
-
'name and a one-line description of when to use it
|
|
7
|
-
'GTM task to check for a relevant playbook, then call load_skill to read the full step-by-step guide. ' +
|
|
8
|
+
'name and a one-line description of when to use it; load_skill reads the full legacy guide. ' +
|
|
8
9
|
'(Claude Code and Cursor load these skills natively; on other agents this is how you reach them.)';
|
|
9
10
|
export const listSkillsSchema = {};
|
|
10
11
|
export async function listSkillsHandler(_input) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-skills.js","sourceRoot":"","sources":["../../src/tools/list-skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAA;AAE3C,MAAM,CAAC,MAAM,qBAAqB,GAChC,
|
|
1
|
+
{"version":3,"file":"list-skills.js","sourceRoot":"","sources":["../../src/tools/list-skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAA;AAE3C,MAAM,CAAC,MAAM,qBAAqB,GAChC,8GAA8G;IAC9G,oGAAoG;IACpG,iDAAiD;IACjD,oGAAoG;IACpG,wGAAwG;IACxG,6FAA6F;IAC7F,kGAAkG,CAAA;AAEpG,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAA;AAElC,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAA+B;IACrE,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,UAAU,EAAE,CAAA;QACjC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAA;IACzF,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,6CAA8C,GAAa,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC;YAC5I,OAAO,EAAE,IAAI;SACd,CAAA;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-skill.d.ts","sourceRoot":"","sources":["../../src/tools/load-skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,aAAa,eAAe,CAAA;AAEzC,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"load-skill.d.ts","sourceRoot":"","sources":["../../src/tools/load-skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,aAAa,eAAe,CAAA;AAEzC,eAAO,MAAM,oBAAoB,QAKK,CAAA;AAEtC,eAAO,MAAM,eAAe;;CAI3B,CAAA;AAED,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;GAcpE"}
|
package/dist/tools/load-skill.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { loadSkill } from '../skills.js';
|
|
3
3
|
export const loadSkillName = 'load_skill';
|
|
4
|
-
export const loadSkillDescription = '
|
|
4
|
+
export const loadSkillDescription = 'Legacy compatibility tool. Prefer search_knowledge for the current task. Loads a ColdIQ GTM playbook ' +
|
|
5
|
+
'("skill") by name — the complete step-by-step expert workflow, ' +
|
|
5
6
|
'including which ColdIQ tools/endpoints to call at each step. Call list_skills first to get the available ' +
|
|
6
7
|
'names. The returned guide (with any referenced reference docs inlined) tells you exactly how to run the ' +
|
|
7
8
|
'task using the other ColdIQ tools.';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-skill.js","sourceRoot":"","sources":["../../src/tools/load-skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAA;AAEzC,MAAM,CAAC,MAAM,oBAAoB,GAC/B,
|
|
1
|
+
{"version":3,"file":"load-skill.js","sourceRoot":"","sources":["../../src/tools/load-skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAA;AAEzC,MAAM,CAAC,MAAM,oBAAoB,GAC/B,uGAAuG;IACvG,iEAAiE;IACjE,2GAA2G;IAC3G,0GAA0G;IAC1G,oCAAoC,CAAA;AAEtC,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,CAAC,gGAAgG,CAAC;CAC9G,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,KAA8B;IACnE,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IAC5C,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,wEAAwE,EAAE,CAAC;YACpH,OAAO,EAAE,IAAI;SACd,CAAA;IACH,CAAC;IACD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,CAAA;QAClC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAA;IAC7D,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAG,GAAa,CAAC,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC9F,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const searchKnowledgeName = "search_knowledge";
|
|
3
|
+
export declare const searchKnowledgeDescription: string;
|
|
4
|
+
export declare const searchKnowledgeSchema: {
|
|
5
|
+
query: z.ZodString;
|
|
6
|
+
types: z.ZodOptional<z.ZodArray<z.ZodEnum<["play", "provider", "strategy"]>, "many">>;
|
|
7
|
+
limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
8
|
+
};
|
|
9
|
+
export declare function searchKnowledgeHandler(input: Record<string, unknown>): Promise<{
|
|
10
|
+
content: {
|
|
11
|
+
type: "text";
|
|
12
|
+
text: string;
|
|
13
|
+
}[];
|
|
14
|
+
isError: boolean;
|
|
15
|
+
} | {
|
|
16
|
+
content: {
|
|
17
|
+
type: "text";
|
|
18
|
+
text: string;
|
|
19
|
+
}[];
|
|
20
|
+
isError?: undefined;
|
|
21
|
+
}>;
|
|
22
|
+
//# sourceMappingURL=search-knowledge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-knowledge.d.ts","sourceRoot":"","sources":["../../src/tools/search-knowledge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,eAAO,MAAM,mBAAmB,qBAAqB,CAAA;AAErD,eAAO,MAAM,0BAA0B,QAIkF,CAAA;AAEzH,eAAO,MAAM,qBAAqB;;;;CAiBjC,CAAA;AAED,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;GAgB1E"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { callApi } from '../client.js';
|
|
3
|
+
const KNOWLEDGE_DOC_TYPES = ['play', 'provider', 'strategy'];
|
|
4
|
+
const DEFAULT_KNOWLEDGE_DOC_TYPES = ['play', 'strategy'];
|
|
5
|
+
export const searchKnowledgeName = 'search_knowledge';
|
|
6
|
+
export const searchKnowledgeDescription = 'MANDATORY FIRST TOOL: for every new substantive GTM task, call search_knowledge before any other ColdIQ tool. ' +
|
|
7
|
+
'Pass the user’s complete task as the query and do not reuse results from a previous task. FREE. Searches ColdIQ ' +
|
|
8
|
+
'plays, provider deep-docs, and GTM strategy, returning ranked metadata and bounded document bodies. Follow the ' +
|
|
9
|
+
'retrieved workflow and provider order. If search fails or returns no usable result, continue with endpoint discovery.';
|
|
10
|
+
export const searchKnowledgeSchema = {
|
|
11
|
+
query: z
|
|
12
|
+
.string()
|
|
13
|
+
.describe('The user’s complete substantive GTM task, including requested entities, filters, outputs, and count.'),
|
|
14
|
+
types: z
|
|
15
|
+
.array(z.enum(KNOWLEDGE_DOC_TYPES))
|
|
16
|
+
.max(3)
|
|
17
|
+
.optional()
|
|
18
|
+
.describe('Optional document filters: play, provider, or strategy. Omit to search plays and strategy; request provider explicitly for provider documentation.'),
|
|
19
|
+
limit: z
|
|
20
|
+
.number()
|
|
21
|
+
.int()
|
|
22
|
+
.min(1)
|
|
23
|
+
.max(15)
|
|
24
|
+
.default(5)
|
|
25
|
+
.optional()
|
|
26
|
+
.describe('Maximum ranked documents to return (default 5, max 15).'),
|
|
27
|
+
};
|
|
28
|
+
export async function searchKnowledgeHandler(input) {
|
|
29
|
+
const res = await callApi('POST', '/knowledge/search', {
|
|
30
|
+
query: input.query,
|
|
31
|
+
types: input.types ?? [...DEFAULT_KNOWLEDGE_DOC_TYPES],
|
|
32
|
+
limit: input.limit,
|
|
33
|
+
});
|
|
34
|
+
if (!res.ok) {
|
|
35
|
+
return {
|
|
36
|
+
content: [{
|
|
37
|
+
type: 'text',
|
|
38
|
+
text: JSON.stringify({ error: 'Knowledge search failed', status: res.status }),
|
|
39
|
+
}],
|
|
40
|
+
isError: true,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return { content: [{ type: 'text', text: JSON.stringify(res.data) }] };
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=search-knowledge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-knowledge.js","sourceRoot":"","sources":["../../src/tools/search-knowledge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,CAAU,CAAA;AACrE,MAAM,2BAA2B,GAAG,CAAC,MAAM,EAAE,UAAU,CAAU,CAAA;AAEjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,kBAAkB,CAAA;AAErD,MAAM,CAAC,MAAM,0BAA0B,GACrC,gHAAgH;IAChH,kHAAkH;IAClH,iHAAiH;IACjH,uHAAuH,CAAA;AAEzH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,CAAC,sGAAsG,CAAC;IACnH,KAAK,EAAE,CAAC;SACL,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;SAClC,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CAAC,oJAAoJ,CAAC;IACjK,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,OAAO,CAAC,CAAC,CAAC;SACV,QAAQ,EAAE;SACV,QAAQ,CAAC,yDAAyD,CAAC;CACvE,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,KAA8B;IACzE,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,mBAAmB,EAAE;QACrD,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,CAAC,GAAG,2BAA2B,CAAC;QACtD,KAAK,EAAE,KAAK,CAAC,KAAK;KACnB,CAAC,CAAA;IACF,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,yBAAyB,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC;iBAC/E,CAAC;YACF,OAAO,EAAE,IAAI;SACd,CAAA;IACH,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAA;AACjF,CAAC"}
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Agent, setGlobalDispatcher } from 'undici'
|
|
2
2
|
import { recordChargeFromHeaders } from './session-usage.js'
|
|
3
|
+
import { readPackageVersion } from './version.js'
|
|
4
|
+
|
|
5
|
+
const packageVersion = readPackageVersion(import.meta.url)
|
|
3
6
|
|
|
4
7
|
export type ApiResponse = {
|
|
5
8
|
ok: boolean
|
|
@@ -56,9 +59,11 @@ export async function callApi(
|
|
|
56
59
|
|
|
57
60
|
const headers: Record<string, string> = {
|
|
58
61
|
Authorization: `Bearer ${_apiKey}`,
|
|
59
|
-
// Client-declared surface attribution, persisted on
|
|
60
|
-
// (analytics only — mirrors src/lib/client-surface.ts
|
|
62
|
+
// Client-declared surface + package-version attribution, persisted on
|
|
63
|
+
// marketplace.usage_logs (analytics only — mirrors src/lib/client-surface.ts
|
|
64
|
+
// in the API repo; lets ColdIQ see which MCP versions are in the wild).
|
|
61
65
|
'X-ColdIQ-Client-Surface': 'mcp',
|
|
66
|
+
'X-ColdIQ-Client-Version': packageVersion,
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
const init: RequestInit = {
|
package/src/index.ts
CHANGED
|
@@ -3,7 +3,15 @@
|
|
|
3
3
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
|
|
4
4
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
5
5
|
import { initClient } from './client.js'
|
|
6
|
+
import { MCP_SERVER_INSTRUCTIONS } from './instructions.js'
|
|
7
|
+
import { withKnowledgeFirstRequirement } from './knowledge-policy.js'
|
|
6
8
|
import { readPackageVersion } from './version.js'
|
|
9
|
+
import {
|
|
10
|
+
searchKnowledgeName,
|
|
11
|
+
searchKnowledgeDescription,
|
|
12
|
+
searchKnowledgeSchema,
|
|
13
|
+
searchKnowledgeHandler,
|
|
14
|
+
} from './tools/search-knowledge.js'
|
|
7
15
|
|
|
8
16
|
import {
|
|
9
17
|
searchCompaniesName,
|
|
@@ -201,55 +209,48 @@ const server = new McpServer(
|
|
|
201
209
|
version: packageVersion,
|
|
202
210
|
},
|
|
203
211
|
{
|
|
204
|
-
|
|
205
|
-
// prospecting flow — the dominant latency driver. Looping these tools
|
|
206
|
-
// per-item multiplies wall-clock with zero quality gain: find_people runs a
|
|
207
|
-
// ~90s async job per call, so N looped calls cost ~N×90s vs ~90s batched.
|
|
208
|
-
instructions: [
|
|
209
|
-
'ColdIQ prospecting tools. Always BATCH, never loop, to keep multi-step prospecting fast:',
|
|
210
|
-
'1. To find people across several companies, make ONE find_people call passing every company in company_linkedin_urls (preferred) or company_domains — never one call per company. Set limit = (results wanted per company) × (number of companies).',
|
|
211
|
-
'2. To find emails for several people, make ONE find_emails call with all of them — never loop find_email per person. find_emails runs providers in parallel and is several times faster.',
|
|
212
|
-
'3. Typical flow: search_companies → find_people (one batched call) → find_emails (one batched call).',
|
|
213
|
-
].join('\n'),
|
|
212
|
+
instructions: MCP_SERVER_INSTRUCTIONS,
|
|
214
213
|
},
|
|
215
214
|
)
|
|
216
215
|
|
|
217
|
-
// Register
|
|
218
|
-
|
|
219
|
-
server.tool(
|
|
220
|
-
server.tool(
|
|
221
|
-
server.tool(
|
|
222
|
-
server.tool(
|
|
223
|
-
server.tool(
|
|
224
|
-
server.tool(
|
|
225
|
-
server.tool(
|
|
226
|
-
server.tool(
|
|
227
|
-
server.tool(
|
|
228
|
-
server.tool(
|
|
229
|
-
server.tool(
|
|
230
|
-
server.tool(
|
|
231
|
-
server.tool(
|
|
232
|
-
server.tool(
|
|
233
|
-
server.tool(
|
|
234
|
-
server.tool(
|
|
235
|
-
server.tool(
|
|
236
|
-
server.tool(
|
|
237
|
-
server.tool(
|
|
238
|
-
server.tool(
|
|
239
|
-
server.tool(
|
|
240
|
-
server.tool(
|
|
241
|
-
server.tool(
|
|
216
|
+
// Register knowledge retrieval before every operational tool so clients that
|
|
217
|
+
// preserve registration order surface the mandatory prerequisite first.
|
|
218
|
+
server.tool(searchKnowledgeName, searchKnowledgeDescription, searchKnowledgeSchema, searchKnowledgeHandler)
|
|
219
|
+
server.tool(searchCompaniesName, withKnowledgeFirstRequirement(searchCompaniesDescription), searchCompaniesSchema, searchCompaniesHandler)
|
|
220
|
+
server.tool(findPeopleName, withKnowledgeFirstRequirement(findPeopleDescription), findPeopleSchema, findPeopleHandler)
|
|
221
|
+
server.tool(findEmailName, withKnowledgeFirstRequirement(findEmailDescription), findEmailSchema, findEmailHandler)
|
|
222
|
+
server.tool(enrichPersonName, withKnowledgeFirstRequirement(enrichPersonDescription), enrichPersonSchema, enrichPersonHandler)
|
|
223
|
+
server.tool(findEmailsName, withKnowledgeFirstRequirement(findEmailsDescription), findEmailsSchema, findEmailsHandler)
|
|
224
|
+
server.tool(verifyEmailName, withKnowledgeFirstRequirement(verifyEmailDescription), verifyEmailSchema, verifyEmailHandler)
|
|
225
|
+
server.tool(verifyEmailsBulkName, withKnowledgeFirstRequirement(verifyEmailsBulkDescription), verifyEmailsBulkSchema, verifyEmailsBulkHandler)
|
|
226
|
+
server.tool(findEmailsBulkName, withKnowledgeFirstRequirement(findEmailsBulkDescription), findEmailsBulkSchema, findEmailsBulkHandler)
|
|
227
|
+
server.tool(enrichPersonBulkName, withKnowledgeFirstRequirement(enrichPersonBulkDescription), enrichPersonBulkSchema, enrichPersonBulkHandler)
|
|
228
|
+
server.tool(enrichCompanyBulkName, withKnowledgeFirstRequirement(enrichCompanyBulkDescription), enrichCompanyBulkSchema, enrichCompanyBulkHandler)
|
|
229
|
+
server.tool(findPhoneBulkName, withKnowledgeFirstRequirement(findPhoneBulkDescription), findPhoneBulkSchema, findPhoneBulkHandler)
|
|
230
|
+
server.tool(getBulkJobName, withKnowledgeFirstRequirement(getBulkJobDescription), getBulkJobSchema, getBulkJobHandler)
|
|
231
|
+
server.tool(cancelBulkJobName, withKnowledgeFirstRequirement(cancelBulkJobDescription), cancelBulkJobSchema, cancelBulkJobHandler)
|
|
232
|
+
server.tool(findPhoneName, withKnowledgeFirstRequirement(findPhoneDescription), findPhoneSchema, findPhoneHandler)
|
|
233
|
+
server.tool(enrichCompanyName, withKnowledgeFirstRequirement(enrichCompanyDescription), enrichCompanySchema, enrichCompanyHandler)
|
|
234
|
+
server.tool(searchWebName, withKnowledgeFirstRequirement(searchWebDescription), searchWebSchema, searchWebHandler)
|
|
235
|
+
server.tool(searchJobsName, withKnowledgeFirstRequirement(searchJobsDescription), searchJobsSchema, searchJobsHandler)
|
|
236
|
+
server.tool(searchAdsName, withKnowledgeFirstRequirement(searchAdsDescription), searchAdsSchema, searchAdsHandler)
|
|
237
|
+
server.tool(searchPlacesName, withKnowledgeFirstRequirement(searchPlacesDescription), searchPlacesSchema, searchPlacesHandler)
|
|
238
|
+
server.tool(findInfluencersName, withKnowledgeFirstRequirement(findInfluencersDescription), findInfluencersSchema, findInfluencersHandler)
|
|
239
|
+
server.tool(searchRedditName, withKnowledgeFirstRequirement(searchRedditDescription), searchRedditSchema, searchRedditHandler)
|
|
240
|
+
server.tool(searchSeoName, withKnowledgeFirstRequirement(searchSeoDescription), searchSeoSchema, searchSeoHandler)
|
|
241
|
+
server.tool(findSignalsName, withKnowledgeFirstRequirement(findSignalsDescription), findSignalsSchema, findSignalsHandler)
|
|
242
|
+
server.tool(fetchPageContentName, withKnowledgeFirstRequirement(fetchPageContentDescription), fetchPageContentSchema, fetchPageContentHandler)
|
|
242
243
|
server.tool(getCreditBalanceName, getCreditBalanceDescription, getCreditBalanceSchema, getCreditBalanceHandler)
|
|
243
244
|
server.tool(getSessionUsageName, getSessionUsageDescription, getSessionUsageSchema, getSessionUsageHandler)
|
|
244
|
-
server.tool(listDataSourcesName, listDataSourcesDescription, listDataSourcesSchema, listDataSourcesHandler)
|
|
245
|
+
server.tool(listDataSourcesName, withKnowledgeFirstRequirement(listDataSourcesDescription), listDataSourcesSchema, listDataSourcesHandler)
|
|
245
246
|
server.tool(listSkillsName, listSkillsDescription, listSkillsSchema, listSkillsHandler)
|
|
246
247
|
server.tool(loadSkillName, loadSkillDescription, loadSkillSchema, loadSkillHandler)
|
|
247
|
-
server.tool(extractPostEngagementName, extractPostEngagementDescription, extractPostEngagementSchema, extractPostEngagementHandler)
|
|
248
|
-
server.tool(getPlaceReviewsName, getPlaceReviewsDescription, getPlaceReviewsSchema, getPlaceReviewsHandler)
|
|
248
|
+
server.tool(extractPostEngagementName, withKnowledgeFirstRequirement(extractPostEngagementDescription), extractPostEngagementSchema, extractPostEngagementHandler)
|
|
249
|
+
server.tool(getPlaceReviewsName, withKnowledgeFirstRequirement(getPlaceReviewsDescription), getPlaceReviewsSchema, getPlaceReviewsHandler)
|
|
249
250
|
// Generic endpoint discovery + invoke: reach any integrated provider without a dedicated tool.
|
|
250
|
-
server.tool(searchEndpointsName, searchEndpointsDescription, searchEndpointsSchema, searchEndpointsHandler)
|
|
251
|
-
server.tool(getEndpointDetailsName, getEndpointDetailsDescription, getEndpointDetailsSchema, getEndpointDetailsHandler)
|
|
252
|
-
server.tool(callEndpointName, callEndpointDescription, callEndpointSchema, callEndpointHandler)
|
|
251
|
+
server.tool(searchEndpointsName, withKnowledgeFirstRequirement(searchEndpointsDescription), searchEndpointsSchema, searchEndpointsHandler)
|
|
252
|
+
server.tool(getEndpointDetailsName, withKnowledgeFirstRequirement(getEndpointDetailsDescription), getEndpointDetailsSchema, getEndpointDetailsHandler)
|
|
253
|
+
server.tool(callEndpointName, withKnowledgeFirstRequirement(callEndpointDescription), callEndpointSchema, callEndpointHandler)
|
|
253
254
|
|
|
254
255
|
// Connect via stdio transport
|
|
255
256
|
const transport = new StdioServerTransport()
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const MANDATORY_KNOWLEDGE_FIRST_RULE =
|
|
2
|
+
'For every new substantive GTM task, you MUST call `search_knowledge` as the first ColdIQ tool, before endpoint discovery or data calls. Pass the user’s complete task as the query. Follow the retrieved play and provider order. Do not reuse knowledge from a previous task. If search fails or returns no usable result, continue with endpoint discovery.'
|
|
3
|
+
|
|
4
|
+
export const MCP_SERVER_INSTRUCTIONS = [
|
|
5
|
+
MANDATORY_KNOWLEDGE_FIRST_RULE,
|
|
6
|
+
'',
|
|
7
|
+
'Retrieved knowledge controls the workflow and provider order; do not invent or override them. Prefer batched dedicated tools when they fit, and batch inputs instead of looping. Otherwise use `search_endpoints` → `get_endpoint_details` → `call_endpoint`.',
|
|
8
|
+
'Stop as soon as the requested count and fields are satisfied. Include source/provider attribution and disclose gaps or uncertainty.',
|
|
9
|
+
'`list_skills` and `load_skill` are legacy compatibility tools; prefer knowledge retrieval. Greetings, acknowledgements, balance checks, and other non-GTM administrative requests may skip knowledge search.',
|
|
10
|
+
].join('\n')
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const KNOWLEDGE_FIRST_REQUIREMENT =
|
|
2
|
+
'For every new substantive GTM task, call search_knowledge as the first ColdIQ tool and pass the user’s complete task as the query.'
|
|
3
|
+
|
|
4
|
+
export function withKnowledgeFirstRequirement(description: string): string {
|
|
5
|
+
return `${KNOWLEDGE_FIRST_REQUIREMENT} ${description}`
|
|
6
|
+
}
|
package/src/tools/list-skills.ts
CHANGED
|
@@ -3,11 +3,12 @@ import { listSkills } from '../skills.js'
|
|
|
3
3
|
export const listSkillsName = 'list_skills'
|
|
4
4
|
|
|
5
5
|
export const listSkillsDescription =
|
|
6
|
-
'
|
|
6
|
+
'Legacy compatibility tool. Prefer search_knowledge for each new substantive GTM task because it returns the ' +
|
|
7
|
+
'current ranked workflow and provider order. Lists the available ColdIQ GTM playbooks ("skills") — ' +
|
|
8
|
+
'step-by-step expert workflows for go-to-market ' +
|
|
7
9
|
'tasks: building a TAM, Apollo / company / people search, contact enrichment and email waterfalls, ' +
|
|
8
10
|
'signal detection, ICP & personas, cold-email copy, campaign delivery, and more. Returns each skill\'s ' +
|
|
9
|
-
'name and a one-line description of when to use it
|
|
10
|
-
'GTM task to check for a relevant playbook, then call load_skill to read the full step-by-step guide. ' +
|
|
11
|
+
'name and a one-line description of when to use it; load_skill reads the full legacy guide. ' +
|
|
11
12
|
'(Claude Code and Cursor load these skills natively; on other agents this is how you reach them.)'
|
|
12
13
|
|
|
13
14
|
export const listSkillsSchema = {}
|
package/src/tools/load-skill.ts
CHANGED
|
@@ -4,7 +4,8 @@ import { loadSkill } from '../skills.js'
|
|
|
4
4
|
export const loadSkillName = 'load_skill'
|
|
5
5
|
|
|
6
6
|
export const loadSkillDescription =
|
|
7
|
-
'
|
|
7
|
+
'Legacy compatibility tool. Prefer search_knowledge for the current task. Loads a ColdIQ GTM playbook ' +
|
|
8
|
+
'("skill") by name — the complete step-by-step expert workflow, ' +
|
|
8
9
|
'including which ColdIQ tools/endpoints to call at each step. Call list_skills first to get the available ' +
|
|
9
10
|
'names. The returned guide (with any referenced reference docs inlined) tells you exactly how to run the ' +
|
|
10
11
|
'task using the other ColdIQ tools.'
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { callApi } from '../client.js'
|
|
3
|
+
|
|
4
|
+
const KNOWLEDGE_DOC_TYPES = ['play', 'provider', 'strategy'] as const
|
|
5
|
+
const DEFAULT_KNOWLEDGE_DOC_TYPES = ['play', 'strategy'] as const
|
|
6
|
+
|
|
7
|
+
export const searchKnowledgeName = 'search_knowledge'
|
|
8
|
+
|
|
9
|
+
export const searchKnowledgeDescription =
|
|
10
|
+
'MANDATORY FIRST TOOL: for every new substantive GTM task, call search_knowledge before any other ColdIQ tool. ' +
|
|
11
|
+
'Pass the user’s complete task as the query and do not reuse results from a previous task. FREE. Searches ColdIQ ' +
|
|
12
|
+
'plays, provider deep-docs, and GTM strategy, returning ranked metadata and bounded document bodies. Follow the ' +
|
|
13
|
+
'retrieved workflow and provider order. If search fails or returns no usable result, continue with endpoint discovery.'
|
|
14
|
+
|
|
15
|
+
export const searchKnowledgeSchema = {
|
|
16
|
+
query: z
|
|
17
|
+
.string()
|
|
18
|
+
.describe('The user’s complete substantive GTM task, including requested entities, filters, outputs, and count.'),
|
|
19
|
+
types: z
|
|
20
|
+
.array(z.enum(KNOWLEDGE_DOC_TYPES))
|
|
21
|
+
.max(3)
|
|
22
|
+
.optional()
|
|
23
|
+
.describe('Optional document filters: play, provider, or strategy. Omit to search plays and strategy; request provider explicitly for provider documentation.'),
|
|
24
|
+
limit: z
|
|
25
|
+
.number()
|
|
26
|
+
.int()
|
|
27
|
+
.min(1)
|
|
28
|
+
.max(15)
|
|
29
|
+
.default(5)
|
|
30
|
+
.optional()
|
|
31
|
+
.describe('Maximum ranked documents to return (default 5, max 15).'),
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export async function searchKnowledgeHandler(input: Record<string, unknown>) {
|
|
35
|
+
const res = await callApi('POST', '/knowledge/search', {
|
|
36
|
+
query: input.query,
|
|
37
|
+
types: input.types ?? [...DEFAULT_KNOWLEDGE_DOC_TYPES],
|
|
38
|
+
limit: input.limit,
|
|
39
|
+
})
|
|
40
|
+
if (!res.ok) {
|
|
41
|
+
return {
|
|
42
|
+
content: [{
|
|
43
|
+
type: 'text' as const,
|
|
44
|
+
text: JSON.stringify({ error: 'Knowledge search failed', status: res.status }),
|
|
45
|
+
}],
|
|
46
|
+
isError: true,
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return { content: [{ type: 'text' as const, text: JSON.stringify(res.data) }] }
|
|
50
|
+
}
|
package/tests/client.test.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs'
|
|
1
2
|
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
|
|
2
3
|
import { initClient, callApi } from '../src/client.js'
|
|
3
4
|
|
|
@@ -53,6 +54,19 @@ describe('client', () => {
|
|
|
53
54
|
expect(capturedHeaders['X-ColdIQ-Client-Surface']).toBe('mcp')
|
|
54
55
|
})
|
|
55
56
|
|
|
57
|
+
it('declares the package version on every request (version attribution)', async () => {
|
|
58
|
+
let capturedHeaders: Record<string, string> = {}
|
|
59
|
+
globalThis.fetch = vi.fn(async (_url: string | URL | Request, init?: RequestInit) => {
|
|
60
|
+
capturedHeaders = Object.fromEntries(Object.entries(init?.headers ?? {}))
|
|
61
|
+
return new Response(JSON.stringify({}), { status: 200 })
|
|
62
|
+
}) as typeof fetch
|
|
63
|
+
|
|
64
|
+
await callApi('GET', '/me/credits')
|
|
65
|
+
|
|
66
|
+
const { version } = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')) as { version: string }
|
|
67
|
+
expect(capturedHeaders['X-ColdIQ-Client-Version']).toBe(version)
|
|
68
|
+
})
|
|
69
|
+
|
|
56
70
|
it('appends query params for GET requests', async () => {
|
|
57
71
|
let capturedUrl = ''
|
|
58
72
|
globalThis.fetch = vi.fn(async (url: string | URL | Request) => {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs'
|
|
2
|
+
import { fileURLToPath } from 'node:url'
|
|
3
|
+
import { describe, expect, it } from 'vitest'
|
|
4
|
+
import {
|
|
5
|
+
MANDATORY_KNOWLEDGE_FIRST_RULE,
|
|
6
|
+
MCP_SERVER_INSTRUCTIONS,
|
|
7
|
+
} from '../src/instructions.js'
|
|
8
|
+
import {
|
|
9
|
+
KNOWLEDGE_FIRST_REQUIREMENT,
|
|
10
|
+
withKnowledgeFirstRequirement,
|
|
11
|
+
} from '../src/knowledge-policy.js'
|
|
12
|
+
|
|
13
|
+
const VALID_INSTRUCTION_TOOL_NAMES = new Set([
|
|
14
|
+
'search_knowledge',
|
|
15
|
+
'search_endpoints',
|
|
16
|
+
'get_endpoint_details',
|
|
17
|
+
'call_endpoint',
|
|
18
|
+
'list_skills',
|
|
19
|
+
'load_skill',
|
|
20
|
+
])
|
|
21
|
+
|
|
22
|
+
describe('MCP knowledge-first policy', () => {
|
|
23
|
+
it('keeps server instructions within client limits and front-loads the complete rule', () => {
|
|
24
|
+
expect(Buffer.byteLength(MCP_SERVER_INSTRUCTIONS, 'utf8')).toBeLessThan(2_048)
|
|
25
|
+
expect(Buffer.byteLength(MANDATORY_KNOWLEDGE_FIRST_RULE, 'utf8')).toBeLessThanOrEqual(512)
|
|
26
|
+
expect(MCP_SERVER_INSTRUCTIONS.startsWith(MANDATORY_KNOWLEDGE_FIRST_RULE)).toBe(true)
|
|
27
|
+
expect(Buffer.from(MCP_SERVER_INSTRUCTIONS, 'utf8').subarray(0, 512).toString())
|
|
28
|
+
.toContain(MANDATORY_KNOWLEDGE_FIRST_RULE)
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it('mentions only real, valid MCP tool names', () => {
|
|
32
|
+
const referencedNames = [...MCP_SERVER_INSTRUCTIONS.matchAll(/`([a-z0-9_-]+)`/g)]
|
|
33
|
+
.map((match) => match[1])
|
|
34
|
+
|
|
35
|
+
expect(referencedNames.length).toBeGreaterThan(0)
|
|
36
|
+
for (const name of referencedNames) {
|
|
37
|
+
expect(name).toMatch(/^[a-zA-Z0-9_-]{1,128}$/)
|
|
38
|
+
expect(VALID_INSTRUCTION_TOOL_NAMES.has(name)).toBe(true)
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
it('prepends the knowledge prerequisite to operational descriptions', () => {
|
|
43
|
+
const description = withKnowledgeFirstRequirement('Perform an operation.')
|
|
44
|
+
|
|
45
|
+
expect(description.startsWith(KNOWLEDGE_FIRST_REQUIREMENT)).toBe(true)
|
|
46
|
+
expect(description).toContain('search_knowledge as the first ColdIQ tool')
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
it('registers search_knowledge first and guards every operational description', () => {
|
|
50
|
+
const indexPath = fileURLToPath(new URL('../src/index.ts', import.meta.url))
|
|
51
|
+
const registrations = readFileSync(indexPath, 'utf8')
|
|
52
|
+
.split('\n')
|
|
53
|
+
.filter((line) => line.trimStart().startsWith('server.tool('))
|
|
54
|
+
const unguardedCompatibilityTools = [
|
|
55
|
+
'getCreditBalanceName',
|
|
56
|
+
'getSessionUsageName',
|
|
57
|
+
'listSkillsName',
|
|
58
|
+
'loadSkillName',
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
expect(registrations[0]).toContain('server.tool(searchKnowledgeName, searchKnowledgeDescription')
|
|
62
|
+
for (const registration of registrations.slice(1)) {
|
|
63
|
+
if (unguardedCompatibilityTools.some((name) => registration.includes(`server.tool(${name},`))) continue
|
|
64
|
+
expect(registration).toContain('withKnowledgeFirstRequirement(')
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
})
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
import { initClient } from '../../src/client.js'
|
|
4
|
+
import {
|
|
5
|
+
searchKnowledgeDescription,
|
|
6
|
+
searchKnowledgeHandler,
|
|
7
|
+
searchKnowledgeName,
|
|
8
|
+
searchKnowledgeSchema,
|
|
9
|
+
} from '../../src/tools/search-knowledge.js'
|
|
10
|
+
|
|
11
|
+
describe('search_knowledge', () => {
|
|
12
|
+
const originalFetch = globalThis.fetch
|
|
13
|
+
|
|
14
|
+
beforeEach(() => initClient('http://test-api.local', 'test-key'))
|
|
15
|
+
afterEach(() => {
|
|
16
|
+
globalThis.fetch = originalFetch
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it('matches the agent schema and repeats the mandatory first-tool rule', () => {
|
|
20
|
+
const schema = z.object(searchKnowledgeSchema).strict()
|
|
21
|
+
|
|
22
|
+
expect(searchKnowledgeName).toBe('search_knowledge')
|
|
23
|
+
expect(searchKnowledgeDescription).toMatch(/mandatory first tool/i)
|
|
24
|
+
expect(searchKnowledgeDescription).toContain('before any other ColdIQ tool')
|
|
25
|
+
expect(schema.parse({ query: 'Find ColdIQ decision makers' })).toEqual({
|
|
26
|
+
query: 'Find ColdIQ decision makers',
|
|
27
|
+
})
|
|
28
|
+
expect(schema.parse({
|
|
29
|
+
query: 'Find ColdIQ decision makers',
|
|
30
|
+
types: ['play', 'provider'],
|
|
31
|
+
limit: 10,
|
|
32
|
+
})).toEqual({
|
|
33
|
+
query: 'Find ColdIQ decision makers',
|
|
34
|
+
types: ['play', 'provider'],
|
|
35
|
+
limit: 10,
|
|
36
|
+
})
|
|
37
|
+
expect(() => schema.parse({ query: 'x', types: ['unknown'] })).toThrow()
|
|
38
|
+
expect(() => schema.parse({ query: 'x', limit: 16 })).toThrow()
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
it('proxies the complete request to /v1/knowledge/search', async () => {
|
|
42
|
+
let capturedUrl = ''
|
|
43
|
+
let capturedBody: unknown
|
|
44
|
+
globalThis.fetch = vi.fn(async (url: string | URL | Request, init?: RequestInit) => {
|
|
45
|
+
capturedUrl = url.toString()
|
|
46
|
+
capturedBody = JSON.parse(String(init?.body))
|
|
47
|
+
return new Response(JSON.stringify({
|
|
48
|
+
results: [{ slug: 'find-people', body: '# Find people' }],
|
|
49
|
+
}), { status: 200 })
|
|
50
|
+
}) as typeof fetch
|
|
51
|
+
|
|
52
|
+
const result = await searchKnowledgeHandler({
|
|
53
|
+
query: 'Find ColdIQ decision makers',
|
|
54
|
+
types: ['play'],
|
|
55
|
+
limit: 3,
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
expect(capturedUrl).toBe('http://test-api.local/v1/knowledge/search')
|
|
59
|
+
expect(capturedBody).toEqual({
|
|
60
|
+
query: 'Find ColdIQ decision makers',
|
|
61
|
+
types: ['play'],
|
|
62
|
+
limit: 3,
|
|
63
|
+
})
|
|
64
|
+
expect(result.isError).toBeFalsy()
|
|
65
|
+
expect(JSON.parse(result.content[0].text).results[0].slug).toBe('find-people')
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
it('defaults to workflow knowledge while preserving explicit provider searches', async () => {
|
|
69
|
+
const bodies: unknown[] = []
|
|
70
|
+
globalThis.fetch = vi.fn(async (_url: string | URL | Request, init?: RequestInit) => {
|
|
71
|
+
bodies.push(JSON.parse(String(init?.body)))
|
|
72
|
+
return new Response(JSON.stringify({ results: [] }), { status: 200 })
|
|
73
|
+
}) as typeof fetch
|
|
74
|
+
|
|
75
|
+
await searchKnowledgeHandler({ query: 'Build a list of ColdIQ decision makers' })
|
|
76
|
+
await searchKnowledgeHandler({ query: 'Apollo request schema', types: ['provider'] })
|
|
77
|
+
|
|
78
|
+
expect(bodies).toEqual([
|
|
79
|
+
{
|
|
80
|
+
query: 'Build a list of ColdIQ decision makers',
|
|
81
|
+
types: ['play', 'strategy'],
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
query: 'Apollo request schema',
|
|
85
|
+
types: ['provider'],
|
|
86
|
+
},
|
|
87
|
+
])
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
it('returns a sanitized error without forwarding response details', async () => {
|
|
91
|
+
globalThis.fetch = vi.fn(async () => new Response(JSON.stringify({
|
|
92
|
+
error: 'database password secret leaked',
|
|
93
|
+
stack: 'internal stack',
|
|
94
|
+
}), { status: 500 })) as typeof fetch
|
|
95
|
+
|
|
96
|
+
const result = await searchKnowledgeHandler({ query: 'Find decision makers' })
|
|
97
|
+
const error = JSON.parse(result.content[0].text)
|
|
98
|
+
|
|
99
|
+
expect(result.isError).toBe(true)
|
|
100
|
+
expect(error).toEqual({ error: 'Knowledge search failed', status: 500 })
|
|
101
|
+
expect(result.content[0].text).not.toContain('secret')
|
|
102
|
+
expect(result.content[0].text).not.toContain('stack')
|
|
103
|
+
})
|
|
104
|
+
})
|