@qverisai/mcp 0.1.2

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.
@@ -0,0 +1,53 @@
1
+ /**
2
+ * search_tools MCP Tool Implementation
3
+ *
4
+ * Searches for available tools based on natural language queries.
5
+ * Returns relevant tools that can help accomplish tasks.
6
+ *
7
+ * @module tools/search
8
+ */
9
+ /**
10
+ * JSON Schema for the search_tools tool input.
11
+ * Used by MCP to validate and document the tool parameters.
12
+ */
13
+ export const searchToolsSchema = {
14
+ type: 'object',
15
+ properties: {
16
+ query: {
17
+ type: 'string',
18
+ description: 'The search query describing the general capability of the tool. ' +
19
+ 'Describe what you want to accomplish, not specific params you want to pass to the tool later. ' +
20
+ 'Example: "weather forecast API", "send email", "stock prices"',
21
+ },
22
+ limit: {
23
+ type: 'number',
24
+ description: 'Maximum number of results to return (1-100)',
25
+ default: 20,
26
+ minimum: 1,
27
+ maximum: 100,
28
+ },
29
+ session_id: {
30
+ type: 'string',
31
+ description: 'Session identifier for tracking user sessions. ' +
32
+ 'If not provided, an auto-generated session ID will be used.',
33
+ },
34
+ },
35
+ required: ['query'],
36
+ };
37
+ /**
38
+ * Executes the search_tools operation.
39
+ *
40
+ * @param client - Initialized Qveris API client
41
+ * @param input - Search parameters
42
+ * @param defaultSessionId - Fallback session ID if not provided in input
43
+ * @returns Search results with matching tools
44
+ */
45
+ export async function executeSearchTools(client, input, defaultSessionId) {
46
+ const response = await client.searchTools({
47
+ query: input.query,
48
+ limit: input.limit ?? 20,
49
+ session_id: input.session_id ?? defaultSessionId,
50
+ });
51
+ return response;
52
+ }
53
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAkCH;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,QAAiB;IACvB,UAAU,EAAE;QACV,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,kEAAkE;gBAClE,gGAAgG;gBAChG,+DAA+D;SAClE;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,6CAA6C;YAC1D,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,GAAG;SACb;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,iDAAiD;gBACjD,6DAA6D;SAChE;KACF;IACD,QAAQ,EAAE,CAAC,OAAO,CAAC;CACpB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,MAAoB,EACpB,KAAuB,EACvB,gBAAwB;IAExB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC;QACxC,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,EAAE;QACxB,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,gBAAgB;KACjD,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,261 @@
1
+ /**
2
+ * Qveris API Type Definitions
3
+ *
4
+ * This module contains TypeScript types that match the Qveris API v0.1.6 schema.
5
+ * All types are fully documented for IDE autocompletion and developer experience.
6
+ *
7
+ * @module types
8
+ * @see {@link https://qveris.ai/api/v1} Qveris API Base URL
9
+ */
10
+ /**
11
+ * Request body for the Search Tools API.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const request: SearchRequest = {
16
+ * query: "weather forecast API",
17
+ * limit: 10,
18
+ * session_id: "abcd1234-ab12-ab12-ab12-abcdef123456"
19
+ * };
20
+ * ```
21
+ */
22
+ export interface SearchRequest {
23
+ /**
24
+ * Natural language search query describing the tool capability you need.
25
+ * @example "weather forecast API"
26
+ * @example "send email notification"
27
+ */
28
+ query: string;
29
+ /**
30
+ * Maximum number of results to return.
31
+ * @default 20
32
+ * @minimum 1
33
+ * @maximum 100
34
+ */
35
+ limit?: number;
36
+ /**
37
+ * Session identifier for tracking user sessions.
38
+ * Same ID corresponds to the same user session.
39
+ */
40
+ session_id?: string;
41
+ }
42
+ /**
43
+ * Parameter definition for a tool.
44
+ * Describes a single input parameter that a tool accepts.
45
+ */
46
+ export interface ToolParameter {
47
+ /** Parameter name (used as key in the parameters object) */
48
+ name: string;
49
+ /** Data type of the parameter */
50
+ type: 'string' | 'number' | 'boolean' | 'array' | 'object';
51
+ /** Whether this parameter must be provided */
52
+ required: boolean;
53
+ /** Human-readable description of what this parameter does */
54
+ description: string;
55
+ /** If present, restricts valid values to this list */
56
+ enum?: string[];
57
+ }
58
+ /**
59
+ * Example usage for a tool, showing sample parameters.
60
+ */
61
+ export interface ToolExamples {
62
+ /** Sample parameter values demonstrating typical usage */
63
+ sample_parameters?: Record<string, unknown>;
64
+ }
65
+ /**
66
+ * Information about a tool returned from search results.
67
+ * Contains everything needed to understand and execute the tool.
68
+ */
69
+ export interface ToolInfo {
70
+ /** Unique identifier for the tool (used in execute_tool) */
71
+ tool_id: string;
72
+ /** Human-readable display name */
73
+ name: string;
74
+ /** Detailed description of what the tool does */
75
+ description: string;
76
+ /** Name of the organization/service providing this tool */
77
+ provider_name?: string;
78
+ /** Description of the provider */
79
+ provider_description?: string;
80
+ /**
81
+ * Geographic availability of the tool.
82
+ * - "global" - Available worldwide
83
+ * - "US|CA" - Whitelist: only available in US and Canada
84
+ * - "!CN|RU" - Blacklist: not available in China and Russia
85
+ */
86
+ region?: string;
87
+ /** Average response latency in milliseconds */
88
+ avg_latency_ms?: number;
89
+ /** List of parameters the tool accepts */
90
+ params?: ToolParameter[];
91
+ /** Usage examples with sample parameters */
92
+ examples?: ToolExamples;
93
+ }
94
+ /**
95
+ * Performance statistics for a search operation.
96
+ */
97
+ export interface SearchStats {
98
+ /** Total time to complete the search in milliseconds */
99
+ search_time_ms: number;
100
+ }
101
+ /**
102
+ * Response from the Search Tools API.
103
+ */
104
+ export interface SearchResponse {
105
+ /** The original search query */
106
+ query?: string;
107
+ /**
108
+ * Unique identifier for this search.
109
+ * Required when calling execute_tool for any tool from these results.
110
+ */
111
+ search_id: string;
112
+ /** Total number of results returned */
113
+ total?: number;
114
+ /** Array of matching tools */
115
+ results: ToolInfo[];
116
+ /** Search performance statistics */
117
+ stats?: SearchStats;
118
+ }
119
+ /**
120
+ * Request body for the Get Tools by IDs API.
121
+ *
122
+ * @example
123
+ * ```typescript
124
+ * const request: GetToolsByIdsRequest = {
125
+ * tool_ids: ["tool-1", "tool-2"],
126
+ * search_id: "search-123",
127
+ * session_id: "abcd1234-ab12-ab12-ab12-abcdef123456"
128
+ * };
129
+ * ```
130
+ */
131
+ export interface GetToolsByIdsRequest {
132
+ /**
133
+ * Array of tool IDs to retrieve information for.
134
+ */
135
+ tool_ids: string[];
136
+ /**
137
+ * The search_id from the search that returned the tool(s).
138
+ * Optional but recommended for analytics and billing.
139
+ */
140
+ search_id?: string;
141
+ /**
142
+ * Session identifier for tracking user sessions.
143
+ * Same ID corresponds to the same user session.
144
+ */
145
+ session_id?: string;
146
+ }
147
+ /**
148
+ * Request body for the Execute Tool API.
149
+ *
150
+ * @example
151
+ * ```typescript
152
+ * const request: ExecuteRequest = {
153
+ * search_id: "abcd1234-ab12-ab12-ab12-abcdef123456",
154
+ * session_id: "abcd1234-ab12-ab12-ab12-abcdef123456",
155
+ * parameters: { city: "London", units: "metric" },
156
+ * max_response_size: 20480
157
+ * };
158
+ * ```
159
+ */
160
+ export interface ExecuteRequest {
161
+ /**
162
+ * The search_id from the search that returned this tool.
163
+ * Links the execution to the original search for analytics.
164
+ */
165
+ search_id: string;
166
+ /**
167
+ * Session identifier for tracking user sessions.
168
+ * Same ID corresponds to the same user session.
169
+ */
170
+ session_id?: string;
171
+ /**
172
+ * Key-value pairs of parameters to pass to the tool.
173
+ * Must match the parameter schema from the tool's definition.
174
+ */
175
+ parameters: Record<string, unknown>;
176
+ /**
177
+ * Maximum size of response data in bytes.
178
+ * If the tool generates data longer than this, it will be truncated
179
+ * and a download URL will be provided for the full content.
180
+ * @default 20480 (20KB)
181
+ * @minimum -1 (-1 means no limit)
182
+ */
183
+ max_response_size?: number;
184
+ }
185
+ /**
186
+ * Result data when the response fits within max_response_size.
187
+ */
188
+ export interface ExecuteResultData {
189
+ /** The actual result data from the tool execution */
190
+ data: unknown;
191
+ }
192
+ /**
193
+ * Result data when the response exceeds max_response_size.
194
+ * Provides truncated content and a URL to download the full result.
195
+ */
196
+ export interface ExecuteResultTruncated {
197
+ /** Explanation message about the truncation */
198
+ message: string;
199
+ /**
200
+ * URL to download the complete result file.
201
+ * Valid for 120 minutes.
202
+ */
203
+ full_content_file_url: string;
204
+ /**
205
+ * The initial portion of the response (max_response_size bytes).
206
+ * Useful for previewing the data structure.
207
+ */
208
+ truncated_content: string;
209
+ }
210
+ /**
211
+ * Union type for execution results (either full data or truncated).
212
+ */
213
+ export type ExecuteResult = ExecuteResultData | ExecuteResultTruncated;
214
+ /**
215
+ * Response from the Execute Tool API.
216
+ */
217
+ export interface ExecuteResponse {
218
+ /** Unique identifier for this execution record */
219
+ execution_id: string;
220
+ /** The tool that was executed */
221
+ tool_id: string;
222
+ /** The parameters that were passed to the tool */
223
+ parameters: Record<string, unknown>;
224
+ /**
225
+ * The execution result.
226
+ * Contains either `data` (if within size limit) or truncation info.
227
+ */
228
+ result?: ExecuteResult;
229
+ /** Whether the execution completed successfully */
230
+ success: boolean;
231
+ /**
232
+ * Error message if execution failed.
233
+ * Common reasons: insufficient balance, quota exceeded, invalid parameters.
234
+ */
235
+ error_message?: string | null;
236
+ /** Execution duration in seconds */
237
+ execution_time?: number;
238
+ /** Timestamp of execution (ISO 8601 format) */
239
+ created_at: string;
240
+ }
241
+ /**
242
+ * Configuration options for the Qveris API client.
243
+ */
244
+ export interface QverisClientConfig {
245
+ /** API authentication token */
246
+ apiKey: string;
247
+ /** Base URL for the API (defaults to production) */
248
+ baseUrl?: string;
249
+ }
250
+ /**
251
+ * Error response from the Qveris API.
252
+ */
253
+ export interface ApiError {
254
+ /** HTTP status code */
255
+ status: number;
256
+ /** Error message */
257
+ message: string;
258
+ /** Original error details if available */
259
+ details?: unknown;
260
+ }
261
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IAEb,iCAAiC;IACjC,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;IAE3D,8CAA8C;IAC9C,QAAQ,EAAE,OAAO,CAAC;IAElB,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;IAEpB,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC7C;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;IAEhB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IAEb,iDAAiD;IACjD,WAAW,EAAE,MAAM,CAAC;IAEpB,2DAA2D;IAC3D,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,kCAAkC;IAClC,oBAAoB,CAAC,EAAE,M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AA+C;IAC/C,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAE9B;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,sBAAsB,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,kDAAkD;IAClD,YAAY,EAAE,MAAM,CAAC;IAErB,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;IAEhB,kDAAkD;IAClD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEpC;;;OAGG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC;IAEvB,mDAAmD;IACnD,OAAO,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B,oCAAoC;IACpC,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;CACpB;AAMD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IAEf,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IAEf,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;IAEhB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
package/dist/types.js ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Qveris API Type Definitions
3
+ *
4
+ * This module contains TypeScript types that match the Qveris API v0.1.6 schema.
5
+ * All types are fully documented for IDE autocompletion and developer experience.
6
+ *
7
+ * @module types
8
+ * @see {@link https://qveris.ai/api/v1} Qveris API Base URL
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@qverisai/mcp",
3
+ "version": "0.1.2",
4
+ "description": "Official Qveris AI MCP Server SDK - Search and execute tools via natural language",
5
+ "keywords": [
6
+ "qveris",
7
+ "mcp",
8
+ "model-context-protocol",
9
+ "ai",
10
+ "tools",
11
+ "sdk"
12
+ ],
13
+ "author": "QverisAI",
14
+ "license": "MIT",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/qverisai/mcp"
18
+ },
19
+ "homepage": "https://github.com/qverisai/mcp#readme",
20
+ "bugs": {
21
+ "url": "https://github.com/qverisai/mcp/issues"
22
+ },
23
+ "type": "module",
24
+ "main": "dist/index.js",
25
+ "types": "dist/index.d.ts",
26
+ "bin": {
27
+ "qveris-mcp": "dist/index.js"
28
+ },
29
+ "files": [
30
+ "dist"
31
+ ],
32
+ "scripts": {
33
+ "build": "tsc",
34
+ "dev": "tsc --watch",
35
+ "start": "node dist/index.js",
36
+ "test": "vitest run",
37
+ "test:watch": "vitest",
38
+ "test:coverage": "vitest run --coverage",
39
+ "prepublishOnly": "npm run build",
40
+ "typecheck": "tsc --noEmit"
41
+ },
42
+ "dependencies": {
43
+ "@modelcontextprotocol/sdk": "^1.0.0",
44
+ "uuid": "^11.0.3"
45
+ },
46
+ "devDependencies": {
47
+ "@types/node": "^22.10.1",
48
+ "@types/uuid": "^10.0.0",
49
+ "typescript": "^5.7.2",
50
+ "vitest": "^2.1.0"
51
+ },
52
+ "engines": {
53
+ "node": ">=18.0.0"
54
+ }
55
+ }