@apify/actors-mcp-server 0.5.9 → 0.6.0
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/README.md +2 -2
- package/dist/actor/types.d.ts +2 -2
- package/dist/actor/types.d.ts.map +1 -1
- package/dist/apify-client.d.ts +2 -2
- package/dist/apify-client.d.ts.map +1 -1
- package/dist/const.d.ts +13 -3
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +55 -1
- package/dist/const.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +33 -15
- package/dist/mcp/server.js.map +1 -1
- package/dist/stdio.js.map +1 -1
- package/dist/telemetry.d.ts +1 -2
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js.map +1 -1
- package/dist/tools/actor.d.ts.map +1 -1
- package/dist/tools/actor.js +47 -19
- package/dist/tools/actor.js.map +1 -1
- package/dist/tools/build.d.ts +2 -6
- package/dist/tools/build.d.ts.map +1 -1
- package/dist/tools/build.js +1 -59
- package/dist/tools/build.js.map +1 -1
- package/dist/tools/dataset.d.ts.map +1 -1
- package/dist/tools/dataset.js +23 -5
- package/dist/tools/dataset.js.map +1 -1
- package/dist/tools/fetch-actor-details.d.ts.map +1 -1
- package/dist/tools/fetch-actor-details.js +15 -6
- package/dist/tools/fetch-actor-details.js.map +1 -1
- package/dist/tools/fetch-apify-docs.d.ts.map +1 -1
- package/dist/tools/fetch-apify-docs.js +23 -8
- package/dist/tools/fetch-apify-docs.js.map +1 -1
- package/dist/tools/get-actor-output.d.ts.map +1 -1
- package/dist/tools/get-actor-output.js +7 -2
- package/dist/tools/get-actor-output.js.map +1 -1
- package/dist/tools/get-html-skeleton.d.ts.map +1 -1
- package/dist/tools/get-html-skeleton.js +19 -6
- package/dist/tools/get-html-skeleton.js.map +1 -1
- package/dist/tools/run.d.ts.map +1 -1
- package/dist/tools/run.js +8 -3
- package/dist/tools/run.js.map +1 -1
- package/dist/tools/run_collection.d.ts.map +1 -1
- package/dist/tools/run_collection.js +4 -1
- package/dist/tools/run_collection.js.map +1 -1
- package/dist/tools/search-apify-docs.d.ts.map +1 -1
- package/dist/tools/search-apify-docs.js +14 -4
- package/dist/tools/search-apify-docs.js.map +1 -1
- package/dist/tools/store_collection.d.ts.map +1 -1
- package/dist/tools/store_collection.js +24 -12
- package/dist/tools/store_collection.js.map +1 -1
- package/dist/tools/structured-output-schemas.d.ts +675 -0
- package/dist/tools/structured-output-schemas.d.ts.map +1 -0
- package/dist/tools/structured-output-schemas.js +169 -0
- package/dist/tools/structured-output-schemas.js.map +1 -0
- package/dist/tools/utils.d.ts +23 -23
- package/dist/tools/utils.d.ts.map +1 -1
- package/dist/tools/utils.js +7 -7
- package/dist/tools/utils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +68 -35
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/actor-card.d.ts +7 -1
- package/dist/utils/actor-card.d.ts.map +1 -1
- package/dist/utils/actor-card.js +69 -1
- package/dist/utils/actor-card.js.map +1 -1
- package/dist/utils/actor-details.d.ts +5 -4
- package/dist/utils/actor-details.d.ts.map +1 -1
- package/dist/utils/actor-details.js +3 -1
- package/dist/utils/actor-details.js.map +1 -1
- package/dist/utils/apify-properties.d.ts +7 -7
- package/dist/utils/apify-properties.d.ts.map +1 -1
- package/dist/utils/apify-properties.js.map +1 -1
- package/dist/utils/mcp-clients.d.ts +1 -1
- package/dist/utils/mcp-clients.d.ts.map +1 -1
- package/dist/utils/mcp.d.ts +18 -4
- package/dist/utils/mcp.d.ts.map +1 -1
- package/dist/utils/mcp.js +20 -4
- package/dist/utils/mcp.js.map +1 -1
- package/dist/utils/pricing-info.d.ts +29 -0
- package/dist/utils/pricing-info.d.ts.map +1 -1
- package/dist/utils/pricing-info.js +50 -0
- package/dist/utils/pricing-info.js.map +1 -1
- package/dist/utils/schema-generation.d.ts +6 -6
- package/dist/utils/schema-generation.d.ts.map +1 -1
- package/dist/utils/schema-generation.js +2 -4
- package/dist/utils/schema-generation.js.map +1 -1
- package/dist/utils/tool-status.d.ts +10 -0
- package/dist/utils/tool-status.d.ts.map +1 -0
- package/dist/utils/tool-status.js +27 -0
- package/dist/utils/tool-status.js.map +1 -0
- package/dist/utils/tools.d.ts +11 -0
- package/dist/utils/tools.d.ts.map +1 -1
- package/dist/utils/tools.js +3 -0
- package/dist/utils/tools.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +3 -5
- package/server.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -4,11 +4,12 @@ import type { InitializeRequest, Notification, Prompt, Request, ToolSchema } fro
|
|
|
4
4
|
import type { ValidateFunction } from 'ajv';
|
|
5
5
|
import type { ActorDefaultRunOptions, ActorDefinition, ActorStoreList, PricingInfo } from 'apify-client';
|
|
6
6
|
import type z from 'zod';
|
|
7
|
-
import type { ACTOR_PRICING_MODEL,
|
|
7
|
+
import type { ACTOR_PRICING_MODEL, TELEMETRY_ENV, TOOL_STATUS } from './const.js';
|
|
8
8
|
import type { ActorsMcpServer } from './mcp/server.js';
|
|
9
9
|
import type { toolCategories } from './tools/index.js';
|
|
10
|
+
import type { StructuredPricingInfo } from './utils/pricing-info.js';
|
|
10
11
|
import type { ProgressTracker } from './utils/progress.js';
|
|
11
|
-
export
|
|
12
|
+
export type SchemaProperties = {
|
|
12
13
|
type: string;
|
|
13
14
|
title: string;
|
|
14
15
|
description: string;
|
|
@@ -16,27 +17,27 @@ export interface ISchemaProperties {
|
|
|
16
17
|
enumTitles?: string[];
|
|
17
18
|
default?: unknown;
|
|
18
19
|
prefill?: unknown;
|
|
19
|
-
items?:
|
|
20
|
+
items?: SchemaProperties;
|
|
20
21
|
editor?: string;
|
|
21
22
|
examples?: unknown[];
|
|
22
|
-
properties?: Record<string,
|
|
23
|
+
properties?: Record<string, SchemaProperties>;
|
|
23
24
|
required?: string[];
|
|
24
|
-
}
|
|
25
|
-
export
|
|
25
|
+
};
|
|
26
|
+
export type ActorInputSchema = {
|
|
26
27
|
$id?: string;
|
|
27
28
|
title?: string;
|
|
28
29
|
description?: string;
|
|
29
30
|
type: string;
|
|
30
|
-
properties: Record<string,
|
|
31
|
+
properties: Record<string, SchemaProperties>;
|
|
31
32
|
required?: string[];
|
|
32
33
|
schemaVersion?: number;
|
|
33
|
-
}
|
|
34
|
+
};
|
|
34
35
|
export type ActorDefinitionWithDesc = Omit<ActorDefinition, 'input'> & {
|
|
35
36
|
id: string;
|
|
36
37
|
actorFullName: string;
|
|
37
38
|
description: string;
|
|
38
39
|
defaultRunOptions: ActorDefaultRunOptions;
|
|
39
|
-
input?:
|
|
40
|
+
input?: ActorInputSchema;
|
|
40
41
|
};
|
|
41
42
|
/**
|
|
42
43
|
* Pruned Actor definition type.
|
|
@@ -46,14 +47,14 @@ export type ActorDefinitionPruned = Pick<ActorDefinitionWithDesc, 'id' | 'actorF
|
|
|
46
47
|
webServerMcpPath?: string;
|
|
47
48
|
};
|
|
48
49
|
/**
|
|
49
|
-
* Base
|
|
50
|
+
* Base type for all tools in the MCP server.
|
|
50
51
|
* Extends the MCP SDK's Tool schema, which requires inputSchema to have type: "object".
|
|
51
52
|
* Adds ajvValidate for runtime validation.
|
|
52
53
|
*/
|
|
53
|
-
export
|
|
54
|
+
export type ToolBase = z.infer<typeof ToolSchema> & {
|
|
54
55
|
/** AJV validation function for the input schema */
|
|
55
56
|
ajvValidate: ValidateFunction;
|
|
56
|
-
}
|
|
57
|
+
};
|
|
57
58
|
/**
|
|
58
59
|
* Type for MCP SDK's inputSchema constraint.
|
|
59
60
|
* Extracted directly from the MCP SDK's ToolSchema to ensure alignment with the specification.
|
|
@@ -62,17 +63,17 @@ export interface ToolBase extends z.infer<typeof ToolSchema> {
|
|
|
62
63
|
*/
|
|
63
64
|
export type ToolInputSchema = z.infer<typeof ToolSchema>['inputSchema'];
|
|
64
65
|
/**
|
|
65
|
-
*
|
|
66
|
+
* Type for Actor-based tools - tools that wrap Apify Actors.
|
|
66
67
|
* Type discriminator: 'actor'
|
|
67
68
|
*/
|
|
68
|
-
export
|
|
69
|
+
export type ActorTool = ToolBase & {
|
|
69
70
|
/** Type discriminator for actor tools */
|
|
70
71
|
type: 'actor';
|
|
71
72
|
/** Full name of the Apify Actor (username/name) */
|
|
72
73
|
actorFullName: string;
|
|
73
74
|
/** Optional memory limit in MB for the Actor execution */
|
|
74
75
|
memoryMbytes?: number;
|
|
75
|
-
}
|
|
76
|
+
};
|
|
76
77
|
/**
|
|
77
78
|
* Arguments passed to internal tool calls.
|
|
78
79
|
* Contains both the tool arguments and server references.
|
|
@@ -102,7 +103,7 @@ export type InternalToolArgs = {
|
|
|
102
103
|
* Helper tool - tools implemented directly in the MCP server.
|
|
103
104
|
* Type discriminator: 'internal'
|
|
104
105
|
*/
|
|
105
|
-
export
|
|
106
|
+
export type HelperTool = ToolBase & {
|
|
106
107
|
/** Type discriminator for helper/internal tools */
|
|
107
108
|
type: 'internal';
|
|
108
109
|
/**
|
|
@@ -111,12 +112,12 @@ export interface HelperTool extends ToolBase {
|
|
|
111
112
|
* @returns Promise resolving to the tool's output
|
|
112
113
|
*/
|
|
113
114
|
call: (toolArgs: InternalToolArgs) => Promise<object>;
|
|
114
|
-
}
|
|
115
|
+
};
|
|
115
116
|
/**
|
|
116
117
|
* Actor MCP tool - tools from Actorized MCP servers that this server proxies.
|
|
117
118
|
* Type discriminator: 'actor-mcp'
|
|
118
119
|
*/
|
|
119
|
-
export
|
|
120
|
+
export type ActorMcpTool = ToolBase & {
|
|
120
121
|
/** Type discriminator for actor MCP tools */
|
|
121
122
|
type: 'actor-mcp';
|
|
122
123
|
/** Origin MCP server tool name is needed for the tool call */
|
|
@@ -130,7 +131,7 @@ export interface ActorMcpTool extends ToolBase {
|
|
|
130
131
|
serverId: string;
|
|
131
132
|
/** Connection URL of the Actorized MCP server */
|
|
132
133
|
serverUrl: string;
|
|
133
|
-
}
|
|
134
|
+
};
|
|
134
135
|
/**
|
|
135
136
|
* Discriminated union of all tool types.
|
|
136
137
|
*
|
|
@@ -143,9 +144,9 @@ export type ToolEntry = HelperTool | ActorTool | ActorMcpTool;
|
|
|
143
144
|
/**
|
|
144
145
|
* Price for a single event in a specific tier.
|
|
145
146
|
*/
|
|
146
|
-
export
|
|
147
|
+
export type TieredEventPrice = {
|
|
147
148
|
tieredEventPriceUsd: number;
|
|
148
|
-
}
|
|
149
|
+
};
|
|
149
150
|
/**
|
|
150
151
|
* Allowed pricing tiers for tiered event pricing.
|
|
151
152
|
*/
|
|
@@ -154,20 +155,20 @@ export type PricingTier = 'FREE' | 'BRONZE' | 'SILVER' | 'GOLD' | 'PLATINUM' | '
|
|
|
154
155
|
* Describes a single chargeable event for an Actor.
|
|
155
156
|
* Supports either flat pricing (eventPriceUsd) or tiered pricing (eventTieredPricingUsd).
|
|
156
157
|
*/
|
|
157
|
-
export
|
|
158
|
+
export type ActorChargeEvent = {
|
|
158
159
|
eventTitle: string;
|
|
159
160
|
eventDescription: string;
|
|
160
161
|
/** Flat price per event in USD (if not tiered) */
|
|
161
162
|
eventPriceUsd?: number;
|
|
162
163
|
/** Tiered pricing per event, by tier name (FREE, BRONZE, etc.) */
|
|
163
164
|
eventTieredPricingUsd?: Partial<Record<PricingTier, TieredEventPrice>>;
|
|
164
|
-
}
|
|
165
|
+
};
|
|
165
166
|
/**
|
|
166
167
|
* Pricing per event for an Actor, supporting both flat and tiered pricing.
|
|
167
168
|
*/
|
|
168
|
-
export
|
|
169
|
+
export type PricingPerEvent = {
|
|
169
170
|
actorChargeEvents: Record<string, ActorChargeEvent>;
|
|
170
|
-
}
|
|
171
|
+
};
|
|
171
172
|
export type ExtendedPricingInfo = PricingInfo & {
|
|
172
173
|
pricePerUnitUsd?: number;
|
|
173
174
|
trialMinutes?: number;
|
|
@@ -206,13 +207,18 @@ export type Input = {
|
|
|
206
207
|
tools?: ToolSelector[] | string;
|
|
207
208
|
};
|
|
208
209
|
export type ActorPricingModel = (typeof ACTOR_PRICING_MODEL)[keyof typeof ACTOR_PRICING_MODEL];
|
|
210
|
+
/**
|
|
211
|
+
* Telemetry environment type.
|
|
212
|
+
* Derived from TELEMETRY_ENV to ensure type safety and avoid duplication.
|
|
213
|
+
*/
|
|
214
|
+
export type TelemetryEnv = (typeof TELEMETRY_ENV)[keyof typeof TELEMETRY_ENV];
|
|
209
215
|
/**
|
|
210
216
|
* Type representing the Actor information needed in order to turn it into an MCP server tool.
|
|
211
217
|
*/
|
|
212
|
-
export
|
|
218
|
+
export type ActorInfo = {
|
|
213
219
|
webServerMcpPath: string | null;
|
|
214
220
|
actorDefinitionPruned: ActorDefinitionPruned;
|
|
215
|
-
}
|
|
221
|
+
};
|
|
216
222
|
export type ExtendedActorStoreList = ActorStoreList & {
|
|
217
223
|
categories?: string[];
|
|
218
224
|
bookmarkCount?: number;
|
|
@@ -228,14 +234,14 @@ export type ActorDefinitionStorage = {
|
|
|
228
234
|
};
|
|
229
235
|
}>;
|
|
230
236
|
};
|
|
231
|
-
export
|
|
237
|
+
export type ApifyDocsSearchResult = {
|
|
232
238
|
/** URL of the documentation page */
|
|
233
239
|
url: string;
|
|
234
240
|
/** Fragment identifier, e.g. "document-heading-1" so LLM knows what section to use when fetching whole document */
|
|
235
241
|
fragment?: string;
|
|
236
242
|
/** Piece of content that matches the search query from Algolia */
|
|
237
243
|
content: string;
|
|
238
|
-
}
|
|
244
|
+
};
|
|
239
245
|
export type PromptBase = Prompt & {
|
|
240
246
|
/**
|
|
241
247
|
* AJV validation function for the prompt arguments.
|
|
@@ -246,7 +252,7 @@ export type PromptBase = Prompt & {
|
|
|
246
252
|
*/
|
|
247
253
|
render: (args: Record<string, string>) => string;
|
|
248
254
|
};
|
|
249
|
-
export type ActorInputSchemaProperties = Record<string,
|
|
255
|
+
export type ActorInputSchemaProperties = Record<string, SchemaProperties>;
|
|
250
256
|
export type DatasetItem = Record<number | string, unknown>;
|
|
251
257
|
/**
|
|
252
258
|
* Apify token type.
|
|
@@ -254,10 +260,15 @@ export type DatasetItem = Record<number | string, unknown>;
|
|
|
254
260
|
* Can be null or undefined in case of Skyfire requests.
|
|
255
261
|
*/
|
|
256
262
|
export type ApifyToken = string | null | undefined;
|
|
263
|
+
/**
|
|
264
|
+
* Unified status type for tool execution lifecycle.
|
|
265
|
+
* Derived from TOOL_STATUS to ensure type safety and avoid duplication.
|
|
266
|
+
*/
|
|
267
|
+
export type ToolStatus = (typeof TOOL_STATUS)[keyof typeof TOOL_STATUS];
|
|
257
268
|
/**
|
|
258
269
|
* Properties for tool call telemetry events sent to Segment.
|
|
259
270
|
*/
|
|
260
|
-
export
|
|
271
|
+
export type ToolCallTelemetryProperties = {
|
|
261
272
|
app: 'mcp';
|
|
262
273
|
app_version: string;
|
|
263
274
|
mcp_client_name: string;
|
|
@@ -267,13 +278,13 @@ export interface ToolCallTelemetryProperties {
|
|
|
267
278
|
mcp_session_id: string;
|
|
268
279
|
transport_type: string;
|
|
269
280
|
tool_name: string;
|
|
270
|
-
tool_status:
|
|
281
|
+
tool_status: ToolStatus;
|
|
271
282
|
tool_exec_time_ms: number;
|
|
272
|
-
}
|
|
283
|
+
};
|
|
273
284
|
/**
|
|
274
285
|
* Options for configuring the ActorsMcpServer instance.
|
|
275
286
|
*/
|
|
276
|
-
export
|
|
287
|
+
export type ActorsMcpServerOptions = {
|
|
277
288
|
setupSigintHandler?: boolean;
|
|
278
289
|
/**
|
|
279
290
|
* Switch to enable Skyfire agentic payment mode.
|
|
@@ -317,5 +328,27 @@ export interface ActorsMcpServerOptions {
|
|
|
317
328
|
* instead of APIFY_TOKEN environment variable, so it can be passed to the server
|
|
318
329
|
*/
|
|
319
330
|
token?: string;
|
|
320
|
-
}
|
|
331
|
+
};
|
|
332
|
+
export type StructuredActorCard = {
|
|
333
|
+
title?: string;
|
|
334
|
+
url: string;
|
|
335
|
+
fullName: string;
|
|
336
|
+
developer: {
|
|
337
|
+
username: string;
|
|
338
|
+
isOfficialApify: boolean;
|
|
339
|
+
url: string;
|
|
340
|
+
};
|
|
341
|
+
description: string;
|
|
342
|
+
categories: string[];
|
|
343
|
+
pricing: StructuredPricingInfo;
|
|
344
|
+
stats?: {
|
|
345
|
+
totalUsers: number;
|
|
346
|
+
monthlyUsers: number;
|
|
347
|
+
successRate?: number;
|
|
348
|
+
bookmarks?: number;
|
|
349
|
+
};
|
|
350
|
+
rating?: number;
|
|
351
|
+
modifiedAt?: string;
|
|
352
|
+
isDeprecated: boolean;
|
|
353
|
+
};
|
|
321
354
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AACvH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACzG,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AACvH,OAAO,KAAK,EAAE,gBAAgB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AE,MAAM,CAAC;QACjB,eAAe,EAAE,OAAO,CAAC;QACzB,GAAG,EAAE,MAAM,CAAC;KACf,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,EAAE,qBAAqB,CAAC;IAC/B,KAAK,CAAC,EAAE;QACJ,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;CACzB,CAAA"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { Actor } from 'apify-client';
|
|
2
|
-
import type { ExtendedActorStoreList } from '../types.js';
|
|
2
|
+
import type { ExtendedActorStoreList, StructuredActorCard } from '../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Formats Actor details into an Actor card (Actor information in markdown).
|
|
5
5
|
* @param actor - Actor information from the API
|
|
6
6
|
* @returns Formatted actor card
|
|
7
7
|
*/
|
|
8
8
|
export declare function formatActorToActorCard(actor: Actor | ExtendedActorStoreList): string;
|
|
9
|
+
/**
|
|
10
|
+
* Extracts structured data from Actor information.
|
|
11
|
+
* @param actor - Actor information from the API
|
|
12
|
+
* @returns Structured actor card data for programmatic use
|
|
13
|
+
*/
|
|
14
|
+
export declare function formatActorToStructuredCard(actor: Actor | ExtendedActorStoreList): StructuredActorCard;
|
|
9
15
|
//# sourceMappingURL=actor-card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actor-card.d.ts","sourceRoot":"","sources":["../../src/utils/actor-card.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,KAAK,EAAE,sBAAsB,EAAuB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"actor-card.d.ts","sourceRoot":"","sources":["../../src/utils/actor-card.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,KAAK,EAAE,sBAAsB,EAAuB,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAkBpG;;;;GAIG;AACH,wBAAgB,sBAAsB,CAClC,KAAK,EAAE,KAAK,GAAG,sBAAsB,GACtC,MAAM,CA2ER;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACvC,KAAK,EAAE,KAAK,GAAG,sBAAsB,GACtC,mBAAmB,CAyErB"}
|
package/dist/utils/actor-card.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { APIFY_STORE_URL } from '../const.js';
|
|
2
|
-
import { getCurrentPricingInfo, pricingInfoToString } from './pricing-info.js';
|
|
2
|
+
import { getCurrentPricingInfo, pricingInfoToString, pricingInfoToStructured } from './pricing-info.js';
|
|
3
3
|
// Helper function to format categories from uppercase with underscores to proper case
|
|
4
4
|
function formatCategories(categories) {
|
|
5
5
|
if (!categories)
|
|
@@ -82,4 +82,72 @@ export function formatActorToActorCard(actor) {
|
|
|
82
82
|
}
|
|
83
83
|
return markdownLines.join('\n');
|
|
84
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Extracts structured data from Actor information.
|
|
87
|
+
* @param actor - Actor information from the API
|
|
88
|
+
* @returns Structured actor card data for programmatic use
|
|
89
|
+
*/
|
|
90
|
+
export function formatActorToStructuredCard(actor) {
|
|
91
|
+
// Format categories for display
|
|
92
|
+
const formattedCategories = formatCategories('categories' in actor ? actor.categories : undefined);
|
|
93
|
+
// Get pricing info - try to extract from the appropriate source
|
|
94
|
+
let pricingInfo = null;
|
|
95
|
+
if ('currentPricingInfo' in actor) {
|
|
96
|
+
// ActorStoreList has currentPricingInfo
|
|
97
|
+
pricingInfo = actor.currentPricingInfo;
|
|
98
|
+
}
|
|
99
|
+
else if ('pricingInfos' in actor && actor.pricingInfos && actor.pricingInfos.length > 0) {
|
|
100
|
+
// Actor has pricingInfos array - get the current one
|
|
101
|
+
pricingInfo = getCurrentPricingInfo(actor.pricingInfos, new Date());
|
|
102
|
+
}
|
|
103
|
+
// If pricingInfo is still null, it means the actor is free (no pricing info means free)
|
|
104
|
+
const pricing = pricingInfoToStructured(pricingInfo);
|
|
105
|
+
const actorFullName = `${actor.username}/${actor.name}`;
|
|
106
|
+
const actorUrl = `${APIFY_STORE_URL}/${actorFullName}`;
|
|
107
|
+
// Build structured data
|
|
108
|
+
const structuredData = {
|
|
109
|
+
title: actor.title,
|
|
110
|
+
url: actorUrl,
|
|
111
|
+
fullName: actorFullName,
|
|
112
|
+
developer: {
|
|
113
|
+
username: actor.username,
|
|
114
|
+
isOfficialApify: actor.username === 'apify',
|
|
115
|
+
url: `${APIFY_STORE_URL}/${actor.username}`,
|
|
116
|
+
},
|
|
117
|
+
description: actor.description || 'No description provided.',
|
|
118
|
+
categories: formattedCategories,
|
|
119
|
+
pricing,
|
|
120
|
+
isDeprecated: ('isDeprecated' in actor && actor.isDeprecated) || false,
|
|
121
|
+
};
|
|
122
|
+
// Add stats if available
|
|
123
|
+
if ('stats' in actor) {
|
|
124
|
+
const { stats } = actor;
|
|
125
|
+
if ('totalUsers' in stats && 'totalUsers30Days' in stats) {
|
|
126
|
+
structuredData.stats = {
|
|
127
|
+
totalUsers: stats.totalUsers,
|
|
128
|
+
monthlyUsers: stats.totalUsers30Days,
|
|
129
|
+
};
|
|
130
|
+
// Add success rate for last 30 days if available
|
|
131
|
+
if ('publicActorRunStats30Days' in stats && stats.publicActorRunStats30Days) {
|
|
132
|
+
const runStats = stats.publicActorRunStats30Days;
|
|
133
|
+
if (runStats.TOTAL > 0) {
|
|
134
|
+
structuredData.stats.successRate = Number(((runStats.SUCCEEDED / runStats.TOTAL) * 100).toFixed(1));
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// Add bookmark count if available (ActorStoreList only)
|
|
138
|
+
if ('bookmarkCount' in actor && actor.bookmarkCount) {
|
|
139
|
+
structuredData.stats.bookmarks = actor.bookmarkCount;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
// Add rating if available (ActorStoreList only)
|
|
144
|
+
if ('actorReviewRating' in actor && actor.actorReviewRating) {
|
|
145
|
+
structuredData.rating = actor.actorReviewRating;
|
|
146
|
+
}
|
|
147
|
+
// Add modification date if available
|
|
148
|
+
if ('modifiedAt' in actor && actor.modifiedAt) {
|
|
149
|
+
structuredData.modifiedAt = actor.modifiedAt.toISOString();
|
|
150
|
+
}
|
|
151
|
+
return structuredData;
|
|
152
|
+
}
|
|
85
153
|
//# sourceMappingURL=actor-card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actor-card.js","sourceRoot":"","sources":["../../src/utils/actor-card.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"actor-card.js","sourceRoot":"","sources":["../../src/utils/actor-card.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAExG,sFAAsF;AACtF,SAAS,gBAAgB,CAAC,UAAqB;IAC3C,IAAI,CAAC,UAAU;QAAE,OAAO,EAAE,CAAC;IAE3B,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC/B,MAAM,SAAS,GAAG,QAAQ;aACrB,WAAW,EAAE;aACb,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC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CAAC;gBAC1E,MAAM,QAAQ,GAAG,KAAK,CAAC,yBAGtB,CAAC;gBACF,IAAI,QAAQ,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;oBACrB,cAAc,CAAC,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;gBACxG,CAAC;YACL,CAAC;YAED,wDAAwD;YACxD,IAAI,eAAe,IAAI,KAAK,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;gBAClD,cAAc,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,aAAa,CAAC;YACzD,CAAC;QACL,CAAC;IACL,CAAC;IAED,gDAAgD;IAChD,IAAI,mBAAmB,IAAI,KAAK,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1D,cAAc,CAAC,MAAM,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACpD,CAAC;IAED,qCAAqC;IACrC,IAAI,YAAY,IAAI,KAAK,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;QAC5C,cAAc,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;IAC/D,CAAC;IAED,OAAO,cAAc,CAAC;AAC1B,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { Actor, Build } from 'apify-client';
|
|
2
2
|
import type { ApifyClient } from '../apify-client.js';
|
|
3
|
-
import type {
|
|
4
|
-
export
|
|
3
|
+
import type { ActorInputSchema, StructuredActorCard } from '../types.js';
|
|
4
|
+
export type ActorDetailsResult = {
|
|
5
5
|
actorInfo: Actor;
|
|
6
6
|
buildInfo: Build;
|
|
7
7
|
actorCard: string;
|
|
8
|
-
|
|
8
|
+
actorCardStructured: StructuredActorCard;
|
|
9
|
+
inputSchema: ActorInputSchema;
|
|
9
10
|
readme: string;
|
|
10
|
-
}
|
|
11
|
+
};
|
|
11
12
|
export declare function fetchActorDetails(apifyClient: ApifyClient, actorName: string): Promise<ActorDetailsResult | null>;
|
|
12
13
|
//# sourceMappingURL=actor-details.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actor-details.d.ts","sourceRoot":"","sources":["../../src/utils/actor-details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"actor-details.d.ts","sourceRoot":"","sources":["../../src/utils/actor-details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAKzE,MAAM,MAAM,kBAAkB,GAAG;IAC7B,SAAS,EAAE,KAAK,CAAC;IACjB,SAAS,EAAE,KAAK,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,WAAW,EAAE,gBAAgB,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CA2BvH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { filterSchemaProperties, shortenProperties } from '../tools/utils.js';
|
|
2
|
-
import { formatActorToActorCard } from './actor-card.js';
|
|
2
|
+
import { formatActorToActorCard, formatActorToStructuredCard } from './actor-card.js';
|
|
3
3
|
import { logHttpError } from './logging.js';
|
|
4
4
|
export async function fetchActorDetails(apifyClient, actorName) {
|
|
5
5
|
try {
|
|
@@ -16,10 +16,12 @@ export async function fetchActorDetails(apifyClient, actorName) {
|
|
|
16
16
|
inputSchema.properties = filterSchemaProperties(inputSchema.properties);
|
|
17
17
|
inputSchema.properties = shortenProperties(inputSchema.properties);
|
|
18
18
|
const actorCard = formatActorToActorCard(actorInfo);
|
|
19
|
+
const actorCardStructured = formatActorToStructuredCard(actorInfo);
|
|
19
20
|
return {
|
|
20
21
|
actorInfo,
|
|
21
22
|
buildInfo,
|
|
22
23
|
actorCard,
|
|
24
|
+
actorCardStructured,
|
|
23
25
|
inputSchema,
|
|
24
26
|
readme: buildInfo.actorDefinition.readme || 'No README provided.',
|
|
25
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actor-details.js","sourceRoot":"","sources":["../../src/utils/actor-details.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"actor-details.js","sourceRoot":"","sources":["../../src/utils/actor-details.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE9E,OAAO,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAY5C,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,WAAwB,EAAE,SAAiB;IAC/E,IAAI,CAAC;QACD,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,GAA2C,MAAM,OAAO,CAAC,GAAG,CAAC;YACrF,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE;YAClC,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;SACjF,CAAC,CAAC;QACH,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,eAAe;YAAE,OAAO,IAAI,CAAC;QACxE,MAAM,WAAW,GAAG,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK,IAAI;YACpD,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;SACjB,CAAqB,CAAC;QACvB,WAAW,CAAC,UAAU,GAAG,sBAAsB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QACxE,WAAW,CAAC,UAAU,GAAG,iBAAiB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QACnE,MAAM,SAAS,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;QACpD,MAAM,mBAAmB,GAAG,2BAA2B,CAAC,SAAS,CAAC,CAAC;QACnE,OAAO;YACH,SAAS;YACT,SAAS;YACT,SAAS;YACT,mBAAmB;YACnB,WAAW;YACX,MAAM,EAAE,SAAS,CAAC,eAAe,CAAC,MAAM,IAAI,qBAAqB;SACpE,CAAC;IACN,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,YAAY,CAAC,KAAK,EAAE,sCAAsC,SAAS,GAAG,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;QACvF,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SchemaProperties } from '../types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Adds resource picker schema structure to array properties with editor === 'resourcePicker'.
|
|
4
4
|
* The resource picker allows users to select resources from their Apify account.
|
|
5
5
|
*/
|
|
6
|
-
export declare function addResourcePickerProperties(property:
|
|
6
|
+
export declare function addResourcePickerProperties(property: SchemaProperties): SchemaProperties;
|
|
7
7
|
/**
|
|
8
8
|
* Adds key-value schema structure to array properties with editor === 'keyValue'.
|
|
9
9
|
*/
|
|
10
|
-
export declare function addKeyValueProperties(property:
|
|
10
|
+
export declare function addKeyValueProperties(property: SchemaProperties): SchemaProperties;
|
|
11
11
|
/**
|
|
12
12
|
* Adds globs schema structure to array properties with editor === 'globs'.
|
|
13
13
|
*/
|
|
14
|
-
export declare function addGlobsProperties(property:
|
|
14
|
+
export declare function addGlobsProperties(property: SchemaProperties): SchemaProperties;
|
|
15
15
|
/**
|
|
16
16
|
* Adds pseudoUrls schema structure to array properties with items.editor === 'pseudoUrls'.
|
|
17
17
|
*/
|
|
18
|
-
export declare function addPseudoUrlsProperties(property:
|
|
18
|
+
export declare function addPseudoUrlsProperties(property: SchemaProperties): SchemaProperties;
|
|
19
19
|
/**
|
|
20
20
|
* Adds Apify proxy-specific properties to a proxy object property.
|
|
21
21
|
*/
|
|
22
|
-
export declare function addProxyProperties(property:
|
|
22
|
+
export declare function addProxyProperties(property: SchemaProperties): SchemaProperties;
|
|
23
23
|
/**
|
|
24
24
|
* Adds request list source structure to array properties with editor 'requestListSources'.
|
|
25
25
|
*/
|
|
26
|
-
export declare function addRequestListSourcesProperties(property:
|
|
26
|
+
export declare function addRequestListSourcesProperties(property: SchemaProperties): SchemaProperties;
|
|
27
27
|
//# sourceMappingURL=apify-properties.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apify-properties.d.ts","sourceRoot":"","sources":["../../src/utils/apify-properties.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"apify-properties.d.ts","sourceRoot":"","sources":["../../src/utils/apify-properties.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAKpD;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,gBAAgB,GAAG,gBAAgB,CAUxF;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,gBAAgB,CAsBlF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,gBAAgB,CAsD/E;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,gBAAgB,CAuDpF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,gBAAgB,CAgD/E;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,gBAAgB,GAAG,gBAAgB,CAmD5F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apify-properties.js","sourceRoot":"","sources":["../../src/utils/apify-properties.ts"],"names":[],"mappings":"AAEA,MAAM,qBAAqB,GAAG,uIAAuI,CAAC;AACtK,MAAM,mBAAmB,GAAG,iHAAiH,CAAC;AAE9I;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,
|
|
1
|
+
{"version":3,"file":"apify-properties.js","sourceRoot":"","sources":["../../src/utils/apify-properties.ts"],"names":[],"mappings":"AAEA,MAAM,qBAAqB,GAAG,uIAAuI,CAAC;AACtK,MAAM,mBAAmB,GAAG,iHAAiH,CAAC;AAE9I;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,QAA0B;IAClE,OAAO;QACH,GAAG,QAAQ;QACX,KAAK,EAAE;YACH,GAAG,QAAQ,CAAC,KAAK;YACjB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,gFAAgF;SAChG;KACJ,CAAC;AACN,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAA0B;IAC5D,OAAO;QACH,GAAG,QAAQ;QACX,KAAK,EAAE;YACH,GAAG,QAAQ,CAAC,KAAK;YACjB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,gBAAgB;YACvB,WAAW,EAAE,2BAA2B;YACxC,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OAAO,EAAE;oBACL,KAAK,EAAE,SAAS;oBAChB,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,qCAAqC;iBACrD;gBACD,QAAQ,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,WAAW;oBAClB,WAAW,EAAE,qBAAqB;oBAClC,UAAU,EAAE,EAAE;iBACjB;gBACD,OAAO,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,SAAS;oBAChB,WAAW,EAAE,mBAAmB;oBAChC,UAAU,EAAE,EAAE;iBACjB;aACJ;SACJ;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-clients.d.ts","sourceRoot":"","sources":["../../src/utils/mcp-clients.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"mcp-clients.d.ts","sourceRoot":"","sources":["../../src/utils/mcp-clients.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAG5E;;GAEG;AACH,wBAAgB,gCAAgC,CAAC,qBAAqB,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAgBnG"}
|
package/dist/utils/mcp.d.ts
CHANGED
|
@@ -1,13 +1,27 @@
|
|
|
1
|
+
import type { ToolStatus } from '../types.js';
|
|
1
2
|
/**
|
|
2
3
|
* Helper to build a response for MCP from an array of text strings.
|
|
3
|
-
* @param
|
|
4
|
-
* @param
|
|
4
|
+
* @param options - Object containing response configuration
|
|
5
|
+
* @param options.texts - Array of text strings to include in the response
|
|
6
|
+
* @param options.isError - Optional flag to mark the response as an error (default: false).
|
|
7
|
+
* This must remain MCP compliant: true for any tool-level error.
|
|
8
|
+
* @param options.toolStatus - Optional internal tool status used for telemetry. When provided,
|
|
9
|
+
* it will be attached as `_toolStatus` so the server can read it
|
|
10
|
+
* and strip it before sending the response to the MCP client.
|
|
11
|
+
* @param options.structuredContent - Optional structured content of unknown type
|
|
5
12
|
*/
|
|
6
|
-
export declare function buildMCPResponse(
|
|
13
|
+
export declare function buildMCPResponse(options: {
|
|
14
|
+
texts: string[];
|
|
15
|
+
isError?: boolean;
|
|
16
|
+
toolStatus?: ToolStatus;
|
|
17
|
+
structuredContent?: unknown;
|
|
18
|
+
}): {
|
|
7
19
|
content: {
|
|
8
|
-
type:
|
|
20
|
+
type: "text";
|
|
9
21
|
text: string;
|
|
10
22
|
}[];
|
|
11
23
|
isError: boolean;
|
|
24
|
+
internalToolStatus?: ToolStatus;
|
|
25
|
+
structuredContent?: unknown;
|
|
12
26
|
};
|
|
13
27
|
//# sourceMappingURL=mcp.d.ts.map
|
package/dist/utils/mcp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/utils/mcp.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/utils/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;;;;GAUG;AAEH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IACtC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;aASgB;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE;aAChC,OAAO;yBACK,UAAU;wBACX,OAAO;EAiBlC"}
|
package/dist/utils/mcp.js
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Helper to build a response for MCP from an array of text strings.
|
|
3
|
-
* @param
|
|
4
|
-
* @param
|
|
3
|
+
* @param options - Object containing response configuration
|
|
4
|
+
* @param options.texts - Array of text strings to include in the response
|
|
5
|
+
* @param options.isError - Optional flag to mark the response as an error (default: false).
|
|
6
|
+
* This must remain MCP compliant: true for any tool-level error.
|
|
7
|
+
* @param options.toolStatus - Optional internal tool status used for telemetry. When provided,
|
|
8
|
+
* it will be attached as `_toolStatus` so the server can read it
|
|
9
|
+
* and strip it before sending the response to the MCP client.
|
|
10
|
+
* @param options.structuredContent - Optional structured content of unknown type
|
|
5
11
|
*/
|
|
6
|
-
export function buildMCPResponse(
|
|
7
|
-
|
|
12
|
+
export function buildMCPResponse(options) {
|
|
13
|
+
const { texts, isError = false, toolStatus, structuredContent, } = options;
|
|
14
|
+
const response = {
|
|
8
15
|
content: texts.map((text) => ({ type: 'text', text })),
|
|
9
16
|
isError,
|
|
10
17
|
};
|
|
18
|
+
// Attach internal tool status for telemetry; server will read and strip it
|
|
19
|
+
if (toolStatus) {
|
|
20
|
+
response.internalToolStatus = toolStatus;
|
|
21
|
+
}
|
|
22
|
+
// Add structured content if provided
|
|
23
|
+
if (structuredContent !== undefined) {
|
|
24
|
+
response.structuredContent = structuredContent;
|
|
25
|
+
}
|
|
26
|
+
return response;
|
|
11
27
|
}
|
|
12
28
|
//# sourceMappingURL=mcp.js.map
|
package/dist/utils/mcp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/utils/mcp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/utils/mcp.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,MAAM,UAAU,gBAAgB,CAAC,OAKhC;IACG,MAAM,EACF,KAAK,EACL,OAAO,GAAG,KAAK,EACf,UAAU,EACV,iBAAiB,GACpB,GAAG,OAAO,CAAC;IAEZ,MAAM,QAAQ,GAKV;QACA,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,OAAO;KACV,CAAC;IAEF,2EAA2E;IAC3E,IAAI,UAAU,EAAE,CAAC;QACb,QAAQ,CAAC,kBAAkB,GAAG,UAAU,CAAC;IAC7C,CAAC;IAED,qCAAqC;IACrC,IAAI,iBAAiB,KAAK,SAAS,EAAE,CAAC;QAClC,QAAQ,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IACnD,CAAC;IAED,OAAO,QAAQ,CAAC;AACpB,CAAC"}
|