@coldiq/mcp 0.3.23 → 0.3.25
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/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/tools/call-endpoint.d.ts +22 -0
- package/dist/tools/call-endpoint.d.ts.map +1 -0
- package/dist/tools/call-endpoint.js +27 -0
- package/dist/tools/call-endpoint.js.map +1 -0
- package/dist/tools/enrich-company.d.ts +1 -1
- package/dist/tools/enrich-company.d.ts.map +1 -1
- package/dist/tools/enrich-company.js +2 -1
- package/dist/tools/enrich-company.js.map +1 -1
- package/dist/tools/get-bulk-job.d.ts.map +1 -1
- package/dist/tools/get-bulk-job.js +7 -5
- package/dist/tools/get-bulk-job.js.map +1 -1
- package/dist/tools/get-endpoint-details.d.ts +21 -0
- package/dist/tools/get-endpoint-details.d.ts.map +1 -0
- package/dist/tools/get-endpoint-details.js +21 -0
- package/dist/tools/get-endpoint-details.js.map +1 -0
- package/dist/tools/search-endpoints.d.ts +21 -0
- package/dist/tools/search-endpoints.d.ts.map +1 -0
- package/dist/tools/search-endpoints.js +31 -0
- package/dist/tools/search-endpoints.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +7 -0
- package/src/tools/call-endpoint.ts +31 -0
- package/src/tools/enrich-company.ts +2 -1
- package/src/tools/get-bulk-job.ts +7 -5
- package/src/tools/get-endpoint-details.ts +25 -0
- package/src/tools/search-endpoints.ts +35 -0
- package/tests/tools/call-endpoint.test.ts +41 -0
- package/tests/tools/get-endpoint-details.test.ts +37 -0
- package/tests/tools/search-endpoints.test.ts +37 -0
package/dist/index.js
CHANGED
|
@@ -14,6 +14,9 @@ import { enrichPersonBulkName, enrichPersonBulkDescription, enrichPersonBulkSche
|
|
|
14
14
|
import { enrichCompanyBulkName, enrichCompanyBulkDescription, enrichCompanyBulkSchema, enrichCompanyBulkHandler } from './tools/enrich-company-bulk.js';
|
|
15
15
|
import { findPhoneBulkName, findPhoneBulkDescription, findPhoneBulkSchema, findPhoneBulkHandler } from './tools/find-phone-bulk.js';
|
|
16
16
|
import { getBulkJobName, getBulkJobDescription, getBulkJobSchema, getBulkJobHandler } from './tools/get-bulk-job.js';
|
|
17
|
+
import { searchEndpointsName, searchEndpointsDescription, searchEndpointsSchema, searchEndpointsHandler } from './tools/search-endpoints.js';
|
|
18
|
+
import { getEndpointDetailsName, getEndpointDetailsDescription, getEndpointDetailsSchema, getEndpointDetailsHandler } from './tools/get-endpoint-details.js';
|
|
19
|
+
import { callEndpointName, callEndpointDescription, callEndpointSchema, callEndpointHandler } from './tools/call-endpoint.js';
|
|
17
20
|
import { findPhoneName, findPhoneDescription, findPhoneSchema, findPhoneHandler, } from './tools/find-phone.js';
|
|
18
21
|
import { enrichCompanyName, enrichCompanyDescription, enrichCompanySchema, enrichCompanyHandler, } from './tools/enrich-company.js';
|
|
19
22
|
import { searchWebName, searchWebDescription, searchWebSchema, searchWebHandler, } from './tools/search-web.js';
|
|
@@ -80,6 +83,10 @@ server.tool(listSkillsName, listSkillsDescription, listSkillsSchema, listSkillsH
|
|
|
80
83
|
server.tool(loadSkillName, loadSkillDescription, loadSkillSchema, loadSkillHandler);
|
|
81
84
|
server.tool(extractPostEngagementName, extractPostEngagementDescription, extractPostEngagementSchema, extractPostEngagementHandler);
|
|
82
85
|
server.tool(getPlaceReviewsName, getPlaceReviewsDescription, getPlaceReviewsSchema, getPlaceReviewsHandler);
|
|
86
|
+
// Generic endpoint discovery + invoke: reach any integrated provider without a dedicated tool.
|
|
87
|
+
server.tool(searchEndpointsName, searchEndpointsDescription, searchEndpointsSchema, searchEndpointsHandler);
|
|
88
|
+
server.tool(getEndpointDetailsName, getEndpointDetailsDescription, getEndpointDetailsSchema, getEndpointDetailsHandler);
|
|
89
|
+
server.tool(callEndpointName, callEndpointDescription, callEndpointSchema, callEndpointHandler);
|
|
83
90
|
// Connect via stdio transport
|
|
84
91
|
const transport = new StdioServerTransport();
|
|
85
92
|
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;AAExC,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,gBAAgB,GACjB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AAClJ,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AACxI,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AAClJ,OAAO,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAA;AACvJ,OAAO,EAAE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,sBAAsB,CAAC,CAAA;AAC3G,MAAM,CAAC,IAAI,CAAC,mBAAmB,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,sBAAsB,CAAC,CAAA;AAC3G,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAA;AACvF,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,oBAAoB,EAAE,eAAe,EAAE,gBAAgB,CAAC,CAAA;AACnF,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE,gCAAgC,EAAE,2BAA2B,EAAE,4BAA4B,CAAC,CAAA;AACnI,MAAM,CAAC,IAAI,CAAC,mBAAmB,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,sBAAsB,CAAC,CAAA;AAC3G,+FAA+F;AAC/F,MAAM,CAAC,IAAI,CAAC,mBAAmB,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,sBAAsB,CAAC,CAAA;AAC3G,MAAM,CAAC,IAAI,CAAC,sBAAsB,EAAE,6BAA6B,EAAE,wBAAwB,EAAE,yBAAyB,CAAC,CAAA;AACvH,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,CAAA;AAE/F,8BAA8B;AAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAA;AAC5C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const callEndpointName = "call_endpoint";
|
|
3
|
+
export declare const callEndpointDescription: string;
|
|
4
|
+
export declare const callEndpointSchema: {
|
|
5
|
+
api: z.ZodString;
|
|
6
|
+
path: z.ZodString;
|
|
7
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
8
|
+
};
|
|
9
|
+
export declare function callEndpointHandler(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=call-endpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-endpoint.d.ts","sourceRoot":"","sources":["../../src/tools/call-endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,gBAAgB,kBAAkB,CAAA;AAE/C,eAAO,MAAM,uBAAuB,QAKgB,CAAA;AAEpD,eAAO,MAAM,kBAAkB;;;;CAO9B,CAAA;AAED,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;GASvE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { callApi } from '../client.js';
|
|
3
|
+
export const callEndpointName = 'call_endpoint';
|
|
4
|
+
export const callEndpointDescription = 'Call any ColdIQ marketplace endpoint directly with provider-native parameters — the generic invoke for ' +
|
|
5
|
+
'providers/capabilities without a dedicated tool. Get the `api`, `path`, and required params from ' +
|
|
6
|
+
'get_endpoint_details first. Returns the provider response verbatim ({ ok, status, data }). ' +
|
|
7
|
+
'PAID: this bills exactly like calling the endpoint directly (same credit cost + upstream call), so only ' +
|
|
8
|
+
'invoke it to perform the action, not to explore.';
|
|
9
|
+
export const callEndpointSchema = {
|
|
10
|
+
api: z.string().describe('Provider key from search_endpoints / get_endpoint_details, e.g. "coldiq".'),
|
|
11
|
+
path: z.string().describe('Endpoint path without the /v1 prefix, e.g. "/coldiq/prospect/people/filter".'),
|
|
12
|
+
params: z
|
|
13
|
+
.record(z.unknown())
|
|
14
|
+
.optional()
|
|
15
|
+
.describe('Provider-native request params (request body fields, plus any path/query params), as shown in get_endpoint_details.'),
|
|
16
|
+
};
|
|
17
|
+
export async function callEndpointHandler(input) {
|
|
18
|
+
const res = await callApi('POST', '/endpoints/use', { api: input.api, path: input.path, params: input.params });
|
|
19
|
+
if (!res.ok) {
|
|
20
|
+
return {
|
|
21
|
+
content: [{ type: 'text', text: JSON.stringify({ error: 'Endpoint call failed', status: res.status, data: res.data }) }],
|
|
22
|
+
isError: true,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
return { content: [{ type: 'text', text: JSON.stringify(res.data) }] };
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=call-endpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-endpoint.js","sourceRoot":"","sources":["../../src/tools/call-endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAA;AAE/C,MAAM,CAAC,MAAM,uBAAuB,GAClC,yGAAyG;IACzG,mGAAmG;IACnG,6FAA6F;IAC7F,0GAA0G;IAC1G,kDAAkD,CAAA;AAEpD,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2EAA2E,CAAC;IACrG,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8EAA8E,CAAC;IACzG,MAAM,EAAE,CAAC;SACN,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SACnB,QAAQ,EAAE;SACV,QAAQ,CAAC,qHAAqH,CAAC;CACnI,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,KAA8B;IACtE,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,gBAAgB,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAA;IAC/G,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,sBAAsB,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;YACjI,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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const enrichCompanyName = "enrich_company";
|
|
3
|
-
export declare const enrichCompanyDescription
|
|
3
|
+
export declare const enrichCompanyDescription: string;
|
|
4
4
|
export declare const enrichCompanySchema: {
|
|
5
5
|
domain: z.ZodOptional<z.ZodString>;
|
|
6
6
|
linkedin_url: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enrich-company.d.ts","sourceRoot":"","sources":["../../src/tools/enrich-company.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,iBAAiB,mBAAmB,CAAA;AAEjD,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"enrich-company.d.ts","sourceRoot":"","sources":["../../src/tools/enrich-company.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,iBAAiB,mBAAmB,CAAA;AAEjD,eAAO,MAAM,wBAAwB,QAEyJ,CAAA;AAE9L,eAAO,MAAM,mBAAmB;;;;;CAK/B,CAAA;AAED,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;GAExE"}
|
|
@@ -2,7 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
import { callVerb } from '../verb-client.js';
|
|
3
3
|
import { getProvidersForCapability } from '../utils/provider-resolver.js';
|
|
4
4
|
export const enrichCompanyName = 'enrich_company';
|
|
5
|
-
export const enrichCompanyDescription = 'Get detailed information about a company. Provide at least one of: domain, linkedin_url, or name. Returns company size, industry, funding, technologies, social profiles, and more. ColdIQ automatically picks the best provider based on which input fields are present — pass use_providers only if you need a specific tool.'
|
|
5
|
+
export const enrichCompanyDescription = 'Get detailed information about a company. Provide at least one of: domain, linkedin_url, or name. Returns company size, industry, funding, technologies, social profiles, and more. ColdIQ automatically picks the best provider based on which input fields are present — pass use_providers only if you need a specific tool. ' +
|
|
6
|
+
'Note: the provider `country` field can be unreliable for multinationals (it reflects an HQ guess and often defaults to US) — prefer the `address`/`phone` fields, which are more accurate.';
|
|
6
7
|
export const enrichCompanySchema = {
|
|
7
8
|
domain: z.string().optional().describe('Company domain (e.g. "stripe.com")'),
|
|
8
9
|
linkedin_url: z.string().url().optional().describe('Company LinkedIn URL (e.g. "https://www.linkedin.com/company/stripe")'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enrich-company.js","sourceRoot":"","sources":["../../src/tools/enrich-company.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAA;AAEzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,gBAAgB,CAAA;AAEjD,MAAM,CAAC,MAAM,wBAAwB,GACnC,
|
|
1
|
+
{"version":3,"file":"enrich-company.js","sourceRoot":"","sources":["../../src/tools/enrich-company.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAA;AAEzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,gBAAgB,CAAA;AAEjD,MAAM,CAAC,MAAM,wBAAwB,GACnC,kUAAkU;IAClU,4LAA4L,CAAA;AAE9L,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IAC5E,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uEAAuE,CAAC;IAC3H,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IACpE,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gLAAgL,yBAAyB,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,qEAAqE,CAAC;CACpW,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,KAA8B;IACvE,OAAO,QAAQ,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-bulk-job.d.ts","sourceRoot":"","sources":["../../src/tools/get-bulk-job.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,cAAc,iBAAiB,CAAA;AAE5C,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"get-bulk-job.d.ts","sourceRoot":"","sources":["../../src/tools/get-bulk-job.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,cAAc,iBAAiB,CAAA;AAE5C,eAAO,MAAM,qBAAqB,QAK2C,CAAA;AAE7E,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAA;AAED,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;GAIrE"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { callApi } from '../client.js';
|
|
3
3
|
export const getBulkJobName = 'get_bulk_job';
|
|
4
|
-
export const getBulkJobDescription = 'Poll
|
|
5
|
-
'Poll until status is "done" (or "timed_out"). Use the `summary`
|
|
6
|
-
'rows come one page at a time (default 100).
|
|
4
|
+
export const getBulkJobDescription = 'Poll any async bulk job (verify_emails_bulk, find_emails_bulk, enrich_person_bulk, enrich_company_bulk, find_phone_bulk). ' +
|
|
5
|
+
'Returns { status, items_total, items_processed, summary, page }. Poll until status is "done" (or "timed_out"). Use the `summary` ' +
|
|
6
|
+
'per-verdict counts for totals — do NOT expect all rows inline: rows come one page at a time (default 100). Each row echoes its ' +
|
|
7
|
+
'submitted `input`, so you can map verdicts back to your submissions without tracking order. To page, OMIT cursor for the first page, ' +
|
|
8
|
+
'then call again with cursor = page.next_cursor until next_cursor is null.';
|
|
7
9
|
export const getBulkJobSchema = {
|
|
8
|
-
job_id: z.number().int().describe('The job_id returned by
|
|
9
|
-
cursor: z.number().int().optional().describe('Pagination cursor (row index
|
|
10
|
+
job_id: z.number().int().describe('The job_id returned by a *_bulk submit tool.'),
|
|
11
|
+
cursor: z.number().int().optional().describe('Pagination cursor from the previous page.next_cursor. Omit for the first page (an inclusive start row index — cursor=0 returns the first row, so never pass a negative or "offset" value).'),
|
|
10
12
|
limit: z.number().int().min(1).max(1000).optional().describe('Rows per page (default 100, max 1000).'),
|
|
11
13
|
};
|
|
12
14
|
export async function getBulkJobHandler(input) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-bulk-job.js","sourceRoot":"","sources":["../../src/tools/get-bulk-job.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAA;AAE5C,MAAM,CAAC,MAAM,qBAAqB,GAChC,
|
|
1
|
+
{"version":3,"file":"get-bulk-job.js","sourceRoot":"","sources":["../../src/tools/get-bulk-job.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAA;AAE5C,MAAM,CAAC,MAAM,qBAAqB,GAChC,4HAA4H;IAC5H,mIAAmI;IACnI,iIAAiI;IACjI,uIAAuI;IACvI,2EAA2E,CAAA;AAE7E,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IACjF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4LAA4L,CAAC;IAC1O,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;CACvG,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,KAA8B;IACpE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAA;IACjC,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,SAAS,MAAM,UAAU,EAAE,IAAI,CAAC,CAAA;IAClE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAA;AACnG,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const getEndpointDetailsName = "get_endpoint_details";
|
|
3
|
+
export declare const getEndpointDetailsDescription: string;
|
|
4
|
+
export declare const getEndpointDetailsSchema: {
|
|
5
|
+
api: z.ZodString;
|
|
6
|
+
path: z.ZodString;
|
|
7
|
+
};
|
|
8
|
+
export declare function getEndpointDetailsHandler(input: Record<string, unknown>): Promise<{
|
|
9
|
+
content: {
|
|
10
|
+
type: "text";
|
|
11
|
+
text: string;
|
|
12
|
+
}[];
|
|
13
|
+
isError: boolean;
|
|
14
|
+
} | {
|
|
15
|
+
content: {
|
|
16
|
+
type: "text";
|
|
17
|
+
text: string;
|
|
18
|
+
}[];
|
|
19
|
+
isError?: undefined;
|
|
20
|
+
}>;
|
|
21
|
+
//# sourceMappingURL=get-endpoint-details.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-endpoint-details.d.ts","sourceRoot":"","sources":["../../src/tools/get-endpoint-details.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,sBAAsB,yBAAyB,CAAA;AAE5D,eAAO,MAAM,6BAA6B,QAGV,CAAA;AAEhC,eAAO,MAAM,wBAAwB;;;CAGpC,CAAA;AAED,wBAAsB,yBAAyB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;GAS7E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { callApi } from '../client.js';
|
|
3
|
+
export const getEndpointDetailsName = 'get_endpoint_details';
|
|
4
|
+
export const getEndpointDetailsDescription = 'Get the real request schema, parameters, a ready-to-run request example, and price for one ColdIQ endpoint ' +
|
|
5
|
+
'(from search_endpoints). Read the example before calling — it shows the exact provider-native params ' +
|
|
6
|
+
'call_endpoint expects. FREE.';
|
|
7
|
+
export const getEndpointDetailsSchema = {
|
|
8
|
+
api: z.string().describe('Provider key from search_endpoints, e.g. "coldiq" (Lima Data), "apollo", or "pdl".'),
|
|
9
|
+
path: z.string().describe('Endpoint path without the /v1 prefix, e.g. "/coldiq/prospect/people/filter".'),
|
|
10
|
+
};
|
|
11
|
+
export async function getEndpointDetailsHandler(input) {
|
|
12
|
+
const res = await callApi('POST', '/endpoints/details', { api: input.api, path: input.path });
|
|
13
|
+
if (!res.ok) {
|
|
14
|
+
return {
|
|
15
|
+
content: [{ type: 'text', text: JSON.stringify({ error: 'Endpoint not found or details unavailable', status: res.status, data: res.data }) }],
|
|
16
|
+
isError: true,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return { content: [{ type: 'text', text: JSON.stringify(res.data) }] };
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=get-endpoint-details.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-endpoint-details.js","sourceRoot":"","sources":["../../src/tools/get-endpoint-details.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,CAAC,MAAM,sBAAsB,GAAG,sBAAsB,CAAA;AAE5D,MAAM,CAAC,MAAM,6BAA6B,GACxC,6GAA6G;IAC7G,uGAAuG;IACvG,8BAA8B,CAAA;AAEhC,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oFAAoF,CAAC;IAC9G,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8EAA8E,CAAC;CAC1G,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,KAA8B;IAC5E,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,oBAAoB,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAA;IAC7F,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,2CAA2C,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;YACtJ,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"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const searchEndpointsName = "search_endpoints";
|
|
3
|
+
export declare const searchEndpointsDescription: string;
|
|
4
|
+
export declare const searchEndpointsSchema: {
|
|
5
|
+
prompt: z.ZodString;
|
|
6
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
};
|
|
8
|
+
export declare function searchEndpointsHandler(input: Record<string, unknown>): Promise<{
|
|
9
|
+
content: {
|
|
10
|
+
type: "text";
|
|
11
|
+
text: string;
|
|
12
|
+
}[];
|
|
13
|
+
isError: boolean;
|
|
14
|
+
} | {
|
|
15
|
+
content: {
|
|
16
|
+
type: "text";
|
|
17
|
+
text: string;
|
|
18
|
+
}[];
|
|
19
|
+
isError?: undefined;
|
|
20
|
+
}>;
|
|
21
|
+
//# sourceMappingURL=search-endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-endpoints.d.ts","sourceRoot":"","sources":["../../src/tools/search-endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,mBAAmB,qBAAqB,CAAA;AAErD,eAAO,MAAM,0BAA0B,QAKmC,CAAA;AAE1E,eAAO,MAAM,qBAAqB;;;CAWjC,CAAA;AAED,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;GAS1E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { callApi } from '../client.js';
|
|
3
|
+
export const searchEndpointsName = 'search_endpoints';
|
|
4
|
+
export const searchEndpointsDescription = 'Discover ColdIQ marketplace API endpoints by natural-language intent — the way to reach ANY integrated ' +
|
|
5
|
+
'provider, including ones without a dedicated tool. Returns matching endpoints grouped by provider, each with ' +
|
|
6
|
+
'its `api`, `path`, summary, and price. Use this when a request names a specific provider (e.g. "find people ' +
|
|
7
|
+
'by title from Lima Data") or needs a capability the fixed tools don\'t cover. Typical flow: search_endpoints → ' +
|
|
8
|
+
'get_endpoint_details (read the request example) → call_endpoint. FREE.';
|
|
9
|
+
export const searchEndpointsSchema = {
|
|
10
|
+
prompt: z
|
|
11
|
+
.string()
|
|
12
|
+
.describe('Natural-language description of the data or capability needed, e.g. "find people by job title" or "Lima Data prospect people".'),
|
|
13
|
+
limit: z
|
|
14
|
+
.number()
|
|
15
|
+
.int()
|
|
16
|
+
.min(1)
|
|
17
|
+
.max(100)
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Maximum number of endpoints to return (default 10).'),
|
|
20
|
+
};
|
|
21
|
+
export async function searchEndpointsHandler(input) {
|
|
22
|
+
const res = await callApi('POST', '/endpoints/search', { prompt: input.prompt, limit: input.limit });
|
|
23
|
+
if (!res.ok) {
|
|
24
|
+
return {
|
|
25
|
+
content: [{ type: 'text', text: JSON.stringify({ error: 'Endpoint search failed', status: res.status, data: res.data }) }],
|
|
26
|
+
isError: true,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return { content: [{ type: 'text', text: JSON.stringify(res.data) }] };
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=search-endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-endpoints.js","sourceRoot":"","sources":["../../src/tools/search-endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,kBAAkB,CAAA;AAErD,MAAM,CAAC,MAAM,0BAA0B,GACrC,yGAAyG;IACzG,+GAA+G;IAC/G,8GAA8G;IAC9G,iHAAiH;IACjH,wEAAwE,CAAA;AAE1E,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,QAAQ,CAAC,gIAAgI,CAAC;IAC7I,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,qDAAqD,CAAC;CACnE,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,KAA8B;IACzE,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,mBAAmB,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAA;IACpG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,wBAAwB,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;YACnI,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/index.ts
CHANGED
|
@@ -52,6 +52,9 @@ import { enrichPersonBulkName, enrichPersonBulkDescription, enrichPersonBulkSche
|
|
|
52
52
|
import { enrichCompanyBulkName, enrichCompanyBulkDescription, enrichCompanyBulkSchema, enrichCompanyBulkHandler } from './tools/enrich-company-bulk.js'
|
|
53
53
|
import { findPhoneBulkName, findPhoneBulkDescription, findPhoneBulkSchema, findPhoneBulkHandler } from './tools/find-phone-bulk.js'
|
|
54
54
|
import { getBulkJobName, getBulkJobDescription, getBulkJobSchema, getBulkJobHandler } from './tools/get-bulk-job.js'
|
|
55
|
+
import { searchEndpointsName, searchEndpointsDescription, searchEndpointsSchema, searchEndpointsHandler } from './tools/search-endpoints.js'
|
|
56
|
+
import { getEndpointDetailsName, getEndpointDetailsDescription, getEndpointDetailsSchema, getEndpointDetailsHandler } from './tools/get-endpoint-details.js'
|
|
57
|
+
import { callEndpointName, callEndpointDescription, callEndpointSchema, callEndpointHandler } from './tools/call-endpoint.js'
|
|
55
58
|
|
|
56
59
|
import {
|
|
57
60
|
findPhoneName,
|
|
@@ -232,6 +235,10 @@ server.tool(listSkillsName, listSkillsDescription, listSkillsSchema, listSkillsH
|
|
|
232
235
|
server.tool(loadSkillName, loadSkillDescription, loadSkillSchema, loadSkillHandler)
|
|
233
236
|
server.tool(extractPostEngagementName, extractPostEngagementDescription, extractPostEngagementSchema, extractPostEngagementHandler)
|
|
234
237
|
server.tool(getPlaceReviewsName, getPlaceReviewsDescription, getPlaceReviewsSchema, getPlaceReviewsHandler)
|
|
238
|
+
// Generic endpoint discovery + invoke: reach any integrated provider without a dedicated tool.
|
|
239
|
+
server.tool(searchEndpointsName, searchEndpointsDescription, searchEndpointsSchema, searchEndpointsHandler)
|
|
240
|
+
server.tool(getEndpointDetailsName, getEndpointDetailsDescription, getEndpointDetailsSchema, getEndpointDetailsHandler)
|
|
241
|
+
server.tool(callEndpointName, callEndpointDescription, callEndpointSchema, callEndpointHandler)
|
|
235
242
|
|
|
236
243
|
// Connect via stdio transport
|
|
237
244
|
const transport = new StdioServerTransport()
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { callApi } from '../client.js'
|
|
3
|
+
|
|
4
|
+
export const callEndpointName = 'call_endpoint'
|
|
5
|
+
|
|
6
|
+
export const callEndpointDescription =
|
|
7
|
+
'Call any ColdIQ marketplace endpoint directly with provider-native parameters — the generic invoke for ' +
|
|
8
|
+
'providers/capabilities without a dedicated tool. Get the `api`, `path`, and required params from ' +
|
|
9
|
+
'get_endpoint_details first. Returns the provider response verbatim ({ ok, status, data }). ' +
|
|
10
|
+
'PAID: this bills exactly like calling the endpoint directly (same credit cost + upstream call), so only ' +
|
|
11
|
+
'invoke it to perform the action, not to explore.'
|
|
12
|
+
|
|
13
|
+
export const callEndpointSchema = {
|
|
14
|
+
api: z.string().describe('Provider key from search_endpoints / get_endpoint_details, e.g. "coldiq".'),
|
|
15
|
+
path: z.string().describe('Endpoint path without the /v1 prefix, e.g. "/coldiq/prospect/people/filter".'),
|
|
16
|
+
params: z
|
|
17
|
+
.record(z.unknown())
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Provider-native request params (request body fields, plus any path/query params), as shown in get_endpoint_details.'),
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export async function callEndpointHandler(input: Record<string, unknown>) {
|
|
23
|
+
const res = await callApi('POST', '/endpoints/use', { api: input.api, path: input.path, params: input.params })
|
|
24
|
+
if (!res.ok) {
|
|
25
|
+
return {
|
|
26
|
+
content: [{ type: 'text' as const, text: JSON.stringify({ error: 'Endpoint call failed', status: res.status, data: res.data }) }],
|
|
27
|
+
isError: true,
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return { content: [{ type: 'text' as const, text: JSON.stringify(res.data) }] }
|
|
31
|
+
}
|
|
@@ -5,7 +5,8 @@ import { getProvidersForCapability } from '../utils/provider-resolver.js'
|
|
|
5
5
|
export const enrichCompanyName = 'enrich_company'
|
|
6
6
|
|
|
7
7
|
export const enrichCompanyDescription =
|
|
8
|
-
'Get detailed information about a company. Provide at least one of: domain, linkedin_url, or name. Returns company size, industry, funding, technologies, social profiles, and more. ColdIQ automatically picks the best provider based on which input fields are present — pass use_providers only if you need a specific tool.'
|
|
8
|
+
'Get detailed information about a company. Provide at least one of: domain, linkedin_url, or name. Returns company size, industry, funding, technologies, social profiles, and more. ColdIQ automatically picks the best provider based on which input fields are present — pass use_providers only if you need a specific tool. ' +
|
|
9
|
+
'Note: the provider `country` field can be unreliable for multinationals (it reflects an HQ guess and often defaults to US) — prefer the `address`/`phone` fields, which are more accurate.'
|
|
9
10
|
|
|
10
11
|
export const enrichCompanySchema = {
|
|
11
12
|
domain: z.string().optional().describe('Company domain (e.g. "stripe.com")'),
|
|
@@ -4,13 +4,15 @@ import { callApi } from '../client.js'
|
|
|
4
4
|
export const getBulkJobName = 'get_bulk_job'
|
|
5
5
|
|
|
6
6
|
export const getBulkJobDescription =
|
|
7
|
-
'Poll
|
|
8
|
-
'Poll until status is "done" (or "timed_out"). Use the `summary`
|
|
9
|
-
'rows come one page at a time (default 100).
|
|
7
|
+
'Poll any async bulk job (verify_emails_bulk, find_emails_bulk, enrich_person_bulk, enrich_company_bulk, find_phone_bulk). ' +
|
|
8
|
+
'Returns { status, items_total, items_processed, summary, page }. Poll until status is "done" (or "timed_out"). Use the `summary` ' +
|
|
9
|
+
'per-verdict counts for totals — do NOT expect all rows inline: rows come one page at a time (default 100). Each row echoes its ' +
|
|
10
|
+
'submitted `input`, so you can map verdicts back to your submissions without tracking order. To page, OMIT cursor for the first page, ' +
|
|
11
|
+
'then call again with cursor = page.next_cursor until next_cursor is null.'
|
|
10
12
|
|
|
11
13
|
export const getBulkJobSchema = {
|
|
12
|
-
job_id: z.number().int().describe('The job_id returned by
|
|
13
|
-
cursor: z.number().int().optional().describe('Pagination cursor (row index
|
|
14
|
+
job_id: z.number().int().describe('The job_id returned by a *_bulk submit tool.'),
|
|
15
|
+
cursor: z.number().int().optional().describe('Pagination cursor from the previous page.next_cursor. Omit for the first page (an inclusive start row index — cursor=0 returns the first row, so never pass a negative or "offset" value).'),
|
|
14
16
|
limit: z.number().int().min(1).max(1000).optional().describe('Rows per page (default 100, max 1000).'),
|
|
15
17
|
}
|
|
16
18
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { callApi } from '../client.js'
|
|
3
|
+
|
|
4
|
+
export const getEndpointDetailsName = 'get_endpoint_details'
|
|
5
|
+
|
|
6
|
+
export const getEndpointDetailsDescription =
|
|
7
|
+
'Get the real request schema, parameters, a ready-to-run request example, and price for one ColdIQ endpoint ' +
|
|
8
|
+
'(from search_endpoints). Read the example before calling — it shows the exact provider-native params ' +
|
|
9
|
+
'call_endpoint expects. FREE.'
|
|
10
|
+
|
|
11
|
+
export const getEndpointDetailsSchema = {
|
|
12
|
+
api: z.string().describe('Provider key from search_endpoints, e.g. "coldiq" (Lima Data), "apollo", or "pdl".'),
|
|
13
|
+
path: z.string().describe('Endpoint path without the /v1 prefix, e.g. "/coldiq/prospect/people/filter".'),
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export async function getEndpointDetailsHandler(input: Record<string, unknown>) {
|
|
17
|
+
const res = await callApi('POST', '/endpoints/details', { api: input.api, path: input.path })
|
|
18
|
+
if (!res.ok) {
|
|
19
|
+
return {
|
|
20
|
+
content: [{ type: 'text' as const, text: JSON.stringify({ error: 'Endpoint not found or details unavailable', status: res.status, data: res.data }) }],
|
|
21
|
+
isError: true,
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return { content: [{ type: 'text' as const, text: JSON.stringify(res.data) }] }
|
|
25
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { callApi } from '../client.js'
|
|
3
|
+
|
|
4
|
+
export const searchEndpointsName = 'search_endpoints'
|
|
5
|
+
|
|
6
|
+
export const searchEndpointsDescription =
|
|
7
|
+
'Discover ColdIQ marketplace API endpoints by natural-language intent — the way to reach ANY integrated ' +
|
|
8
|
+
'provider, including ones without a dedicated tool. Returns matching endpoints grouped by provider, each with ' +
|
|
9
|
+
'its `api`, `path`, summary, and price. Use this when a request names a specific provider (e.g. "find people ' +
|
|
10
|
+
'by title from Lima Data") or needs a capability the fixed tools don\'t cover. Typical flow: search_endpoints → ' +
|
|
11
|
+
'get_endpoint_details (read the request example) → call_endpoint. FREE.'
|
|
12
|
+
|
|
13
|
+
export const searchEndpointsSchema = {
|
|
14
|
+
prompt: z
|
|
15
|
+
.string()
|
|
16
|
+
.describe('Natural-language description of the data or capability needed, e.g. "find people by job title" or "Lima Data prospect people".'),
|
|
17
|
+
limit: z
|
|
18
|
+
.number()
|
|
19
|
+
.int()
|
|
20
|
+
.min(1)
|
|
21
|
+
.max(100)
|
|
22
|
+
.optional()
|
|
23
|
+
.describe('Maximum number of endpoints to return (default 10).'),
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function searchEndpointsHandler(input: Record<string, unknown>) {
|
|
27
|
+
const res = await callApi('POST', '/endpoints/search', { prompt: input.prompt, limit: input.limit })
|
|
28
|
+
if (!res.ok) {
|
|
29
|
+
return {
|
|
30
|
+
content: [{ type: 'text' as const, text: JSON.stringify({ error: 'Endpoint search failed', status: res.status, data: res.data }) }],
|
|
31
|
+
isError: true,
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return { content: [{ type: 'text' as const, text: JSON.stringify(res.data) }] }
|
|
35
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'
|
|
2
|
+
import { initClient } from '../../src/client.js'
|
|
3
|
+
import { callEndpointHandler } from '../../src/tools/call-endpoint.js'
|
|
4
|
+
|
|
5
|
+
describe('call_endpoint handler', () => {
|
|
6
|
+
const originalFetch = globalThis.fetch
|
|
7
|
+
|
|
8
|
+
beforeEach(() => initClient('http://test-api.local', 'test-key'))
|
|
9
|
+
afterEach(() => { globalThis.fetch = originalFetch })
|
|
10
|
+
|
|
11
|
+
it('POSTs api + path + params to /v1/endpoints/use, forwarding the bearer key', async () => {
|
|
12
|
+
let capturedUrl = ''
|
|
13
|
+
let capturedAuth: string | null = null
|
|
14
|
+
let capturedBody: unknown
|
|
15
|
+
globalThis.fetch = vi.fn(async (url: string | URL | Request, opts?: RequestInit) => {
|
|
16
|
+
capturedUrl = url.toString()
|
|
17
|
+
capturedAuth = ((opts?.headers ?? {}) as Record<string, string>).Authorization ?? null
|
|
18
|
+
capturedBody = opts?.body ? JSON.parse(opts.body as string) : undefined
|
|
19
|
+
return new Response(JSON.stringify({ ok: true, status: 200, data: { people: [{ full_name: 'A' }] } }), { status: 200 })
|
|
20
|
+
}) as typeof fetch
|
|
21
|
+
|
|
22
|
+
const params = { filters: [{ filter_type: 'current_title', values: ['Head of Growth'] }] }
|
|
23
|
+
const result = await callEndpointHandler({ api: 'coldiq', path: '/coldiq/prospect/people/filter', params })
|
|
24
|
+
|
|
25
|
+
expect(capturedUrl).toBe('http://test-api.local/v1/endpoints/use')
|
|
26
|
+
expect(capturedAuth).toBe('Bearer test-key')
|
|
27
|
+
expect(capturedBody).toEqual({ api: 'coldiq', path: '/coldiq/prospect/people/filter', params })
|
|
28
|
+
expect(result.isError).toBeFalsy()
|
|
29
|
+
const parsed = JSON.parse(result.content[0].text)
|
|
30
|
+
expect(parsed.data.people).toHaveLength(1)
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it('returns isError when the call fails (e.g. unknown endpoint 404)', async () => {
|
|
34
|
+
globalThis.fetch = vi.fn(async () => new Response(JSON.stringify({ error: 'Endpoint not found for api=coldiq path=/nope', code: -32004 }), { status: 404 })) as typeof fetch
|
|
35
|
+
const result = await callEndpointHandler({ api: 'coldiq', path: '/nope', params: {} })
|
|
36
|
+
expect(result.isError).toBe(true)
|
|
37
|
+
const parsed = JSON.parse(result.content[0].text)
|
|
38
|
+
expect(parsed.status).toBe(404)
|
|
39
|
+
expect(parsed.error).toBe('Endpoint call failed')
|
|
40
|
+
})
|
|
41
|
+
})
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'
|
|
2
|
+
import { initClient } from '../../src/client.js'
|
|
3
|
+
import { getEndpointDetailsHandler } from '../../src/tools/get-endpoint-details.js'
|
|
4
|
+
|
|
5
|
+
describe('get_endpoint_details handler', () => {
|
|
6
|
+
const originalFetch = globalThis.fetch
|
|
7
|
+
|
|
8
|
+
beforeEach(() => initClient('http://test-api.local', 'test-key'))
|
|
9
|
+
afterEach(() => { globalThis.fetch = originalFetch })
|
|
10
|
+
|
|
11
|
+
it('POSTs api + path to /v1/endpoints/details and returns the payload', async () => {
|
|
12
|
+
let capturedUrl = ''
|
|
13
|
+
let capturedBody: unknown
|
|
14
|
+
globalThis.fetch = vi.fn(async (url: string | URL | Request, opts?: RequestInit) => {
|
|
15
|
+
capturedUrl = url.toString()
|
|
16
|
+
capturedBody = opts?.body ? JSON.parse(opts.body as string) : undefined
|
|
17
|
+
return new Response(JSON.stringify({ path: '/coldiq/prospect/people/filter', method: 'post' }), { status: 200 })
|
|
18
|
+
}) as typeof fetch
|
|
19
|
+
|
|
20
|
+
const result = await getEndpointDetailsHandler({ api: 'coldiq', path: '/coldiq/prospect/people/filter' })
|
|
21
|
+
|
|
22
|
+
expect(capturedUrl).toBe('http://test-api.local/v1/endpoints/details')
|
|
23
|
+
expect(capturedBody).toEqual({ api: 'coldiq', path: '/coldiq/prospect/people/filter' })
|
|
24
|
+
expect(result.isError).toBeFalsy()
|
|
25
|
+
const parsed = JSON.parse(result.content[0].text)
|
|
26
|
+
expect(parsed.path).toContain('prospect/people/filter')
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
it('returns isError when the endpoint is unknown (404)', async () => {
|
|
30
|
+
globalThis.fetch = vi.fn(async () => new Response(JSON.stringify({ error: 'not found' }), { status: 404 })) as typeof fetch
|
|
31
|
+
const result = await getEndpointDetailsHandler({ api: 'coldiq', path: '/nope' })
|
|
32
|
+
expect(result.isError).toBe(true)
|
|
33
|
+
const parsed = JSON.parse(result.content[0].text)
|
|
34
|
+
expect(parsed.status).toBe(404)
|
|
35
|
+
expect(parsed.error).toBe('Endpoint not found or details unavailable')
|
|
36
|
+
})
|
|
37
|
+
})
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'
|
|
2
|
+
import { initClient } from '../../src/client.js'
|
|
3
|
+
import { searchEndpointsHandler } from '../../src/tools/search-endpoints.js'
|
|
4
|
+
|
|
5
|
+
describe('search_endpoints handler', () => {
|
|
6
|
+
const originalFetch = globalThis.fetch
|
|
7
|
+
|
|
8
|
+
beforeEach(() => initClient('http://test-api.local', 'test-key'))
|
|
9
|
+
afterEach(() => { globalThis.fetch = originalFetch })
|
|
10
|
+
|
|
11
|
+
it('POSTs prompt + limit to /v1/endpoints/search and returns the payload', async () => {
|
|
12
|
+
let capturedUrl = ''
|
|
13
|
+
let capturedBody: unknown
|
|
14
|
+
globalThis.fetch = vi.fn(async (url: string | URL | Request, opts?: RequestInit) => {
|
|
15
|
+
capturedUrl = url.toString()
|
|
16
|
+
capturedBody = opts?.body ? JSON.parse(opts.body as string) : undefined
|
|
17
|
+
return new Response(JSON.stringify({ results: [{ api: 'coldiq', provider: 'Lima Data', endpoints: [] }] }), { status: 200 })
|
|
18
|
+
}) as typeof fetch
|
|
19
|
+
|
|
20
|
+
const result = await searchEndpointsHandler({ prompt: 'find people by title', limit: 5 })
|
|
21
|
+
|
|
22
|
+
expect(capturedUrl).toBe('http://test-api.local/v1/endpoints/search')
|
|
23
|
+
expect(capturedBody).toEqual({ prompt: 'find people by title', limit: 5 })
|
|
24
|
+
expect(result.isError).toBeFalsy()
|
|
25
|
+
const parsed = JSON.parse(result.content[0].text)
|
|
26
|
+
expect(parsed.results[0].api).toBe('coldiq')
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
it('returns isError when the API responds non-2xx', async () => {
|
|
30
|
+
globalThis.fetch = vi.fn(async () => new Response(JSON.stringify({ error: 'boom' }), { status: 500 })) as typeof fetch
|
|
31
|
+
const result = await searchEndpointsHandler({ prompt: 'x' })
|
|
32
|
+
expect(result.isError).toBe(true)
|
|
33
|
+
const parsed = JSON.parse(result.content[0].text)
|
|
34
|
+
expect(parsed.status).toBe(500)
|
|
35
|
+
expect(parsed.error).toBe('Endpoint search failed')
|
|
36
|
+
})
|
|
37
|
+
})
|