@qverisai/sdk 0.1.2 → 0.2.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/LICENSE +1 -1
- package/README.md +93 -216
- package/dist/client.d.ts +106 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +293 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +25 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +34 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +14 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -260
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +260 -62
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -2
- package/dist/types.js.map +1 -1
- package/package.json +53 -55
- package/dist/api/client.d.ts +0 -147
- package/dist/api/client.d.ts.map +0 -1
- package/dist/api/client.js +0 -201
- package/dist/api/client.js.map +0 -1
- package/dist/tools/execute.d.ts +0 -89
- package/dist/tools/execute.d.ts.map +0 -1
- package/dist/tools/execute.js +0 -73
- package/dist/tools/execute.js.map +0 -1
- package/dist/tools/get-by-ids.d.ts +0 -69
- package/dist/tools/get-by-ids.d.ts.map +0 -1
- package/dist/tools/get-by-ids.js +0 -55
- package/dist/tools/get-by-ids.js.map +0 -1
- package/dist/tools/search.d.ts +0 -71
- package/dist/tools/search.d.ts.map +0 -1
- package/dist/tools/search.js +0 -53
- package/dist/tools/search.js.map +0 -1
package/dist/api/client.d.ts
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Qveris API HTTP Client
|
|
3
|
-
*
|
|
4
|
-
* Provides a type-safe HTTP client for interacting with the Qveris REST API.
|
|
5
|
-
* Handles authentication, request formatting, and error handling.
|
|
6
|
-
*
|
|
7
|
-
* @module api/client
|
|
8
|
-
*/
|
|
9
|
-
import type { SearchRequest, SearchResponse, GetToolsByIdsRequest, ExecuteRequest, ExecuteResponse, QverisClientConfig } from '../types.js';
|
|
10
|
-
/**
|
|
11
|
-
* Qveris API Client
|
|
12
|
-
*
|
|
13
|
-
* A lightweight HTTP client for the Qveris API using native fetch.
|
|
14
|
-
* Requires Node.js 18+ for native fetch support.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* const client = new QverisClient({ apiKey: 'your-api-key' });
|
|
19
|
-
*
|
|
20
|
-
* // Search for tools
|
|
21
|
-
* const searchResult = await client.searchTools({
|
|
22
|
-
* query: 'weather API',
|
|
23
|
-
* limit: 5
|
|
24
|
-
* });
|
|
25
|
-
*
|
|
26
|
-
* // Execute a tool
|
|
27
|
-
* const execResult = await client.executeTool('tool-id', {
|
|
28
|
-
* search_id: searchResult.search_id,
|
|
29
|
-
* parameters: { city: 'London' }
|
|
30
|
-
* });
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export declare class QverisClient {
|
|
34
|
-
private readonly apiKey;
|
|
35
|
-
private readonly baseUrl;
|
|
36
|
-
/**
|
|
37
|
-
* Creates a new Qveris API client.
|
|
38
|
-
*
|
|
39
|
-
* @param config - Client configuration
|
|
40
|
-
* @throws {Error} If apiKey is not provided
|
|
41
|
-
*/
|
|
42
|
-
constructor(config: QverisClientConfig);
|
|
43
|
-
/**
|
|
44
|
-
* Makes an authenticated HTTP request to the Qveris API.
|
|
45
|
-
*
|
|
46
|
-
* @param method - HTTP method
|
|
47
|
-
* @param endpoint - API endpoint (relative to base URL)
|
|
48
|
-
* @param body - Request body (will be JSON serialized)
|
|
49
|
-
* @returns Parsed JSON response
|
|
50
|
-
* @throws {ApiError} If the request fails
|
|
51
|
-
*/
|
|
52
|
-
private request;
|
|
53
|
-
/**
|
|
54
|
-
* Search for tools based on a natural language query.
|
|
55
|
-
*
|
|
56
|
-
* Finds tools that match the described capability. Results include
|
|
57
|
-
* tool metadata, parameter schemas, and usage examples.
|
|
58
|
-
*
|
|
59
|
-
* @param request - Search parameters
|
|
60
|
-
* @returns Search results with matching tools
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
* ```typescript
|
|
64
|
-
* const result = await client.searchTools({
|
|
65
|
-
* query: 'send SMS message',
|
|
66
|
-
* limit: 10,
|
|
67
|
-
* session_id: 'abcd1234-ab12-ab12-ab12-abcdef123456'
|
|
68
|
-
* });
|
|
69
|
-
*
|
|
70
|
-
* console.log(`Found ${result.total} tools`);
|
|
71
|
-
* for (const tool of result.results) {
|
|
72
|
-
* console.log(`- ${tool.name}: ${tool.description}`);
|
|
73
|
-
* }
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
searchTools(request: SearchRequest): Promise<SearchResponse>;
|
|
77
|
-
/**
|
|
78
|
-
* Get tool descriptions by their IDs.
|
|
79
|
-
*
|
|
80
|
-
* Retrieves detailed information about specific tools when you already
|
|
81
|
-
* know their tool_ids. Useful for refreshing tool metadata or getting
|
|
82
|
-
* details for tools from previous searches.
|
|
83
|
-
*
|
|
84
|
-
* @param request - Request parameters with tool IDs
|
|
85
|
-
* @returns Tool information matching the provided IDs
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```typescript
|
|
89
|
-
* const result = await client.getToolsByIds({
|
|
90
|
-
* tool_ids: ['weather-tool-1', 'email-tool-2'],
|
|
91
|
-
* search_id: 'abcd1234-ab12-ab12-ab12-abcdef123456',
|
|
92
|
-
* session_id: 'abcd1234-ab12-ab12-ab12-abcdef123456'
|
|
93
|
-
* });
|
|
94
|
-
*
|
|
95
|
-
* console.log(`Retrieved ${result.results.length} tools`);
|
|
96
|
-
* for (const tool of result.results) {
|
|
97
|
-
* console.log(`- ${tool.name}: ${tool.description}`);
|
|
98
|
-
* }
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
101
|
-
getToolsByIds(request: GetToolsByIdsRequest): Promise<SearchResponse>;
|
|
102
|
-
/**
|
|
103
|
-
* Execute a tool with the specified parameters.
|
|
104
|
-
*
|
|
105
|
-
* The tool_id must come from a previous searchTools call.
|
|
106
|
-
* The search_id links this execution to that search for analytics.
|
|
107
|
-
*
|
|
108
|
-
* @param toolId - The tool identifier from search results
|
|
109
|
-
* @param request - Execution parameters
|
|
110
|
-
* @returns Execution result
|
|
111
|
-
*
|
|
112
|
-
* @example
|
|
113
|
-
* ```typescript
|
|
114
|
-
* const result = await client.executeTool('openweathermap_current', {
|
|
115
|
-
* search_id: 'abcd1234-ab12-ab12-ab12-abcdef123456',
|
|
116
|
-
* session_id: 'abcd1234-ab12-ab12-ab12-abcdef123456',
|
|
117
|
-
* parameters: {
|
|
118
|
-
* city: 'Tokyo',
|
|
119
|
-
* units: 'metric'
|
|
120
|
-
* }
|
|
121
|
-
* });
|
|
122
|
-
*
|
|
123
|
-
* if (result.success) {
|
|
124
|
-
* console.log('Result:', result.result);
|
|
125
|
-
* } else {
|
|
126
|
-
* console.error('Failed:', result.error_message);
|
|
127
|
-
* }
|
|
128
|
-
* ```
|
|
129
|
-
*/
|
|
130
|
-
executeTool(toolId: string, request: ExecuteRequest): Promise<ExecuteResponse>;
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Creates a Qveris client from environment variables.
|
|
134
|
-
*
|
|
135
|
-
* Reads the API key from the QVERIS_API_KEY environment variable.
|
|
136
|
-
*
|
|
137
|
-
* @returns Configured Qveris client
|
|
138
|
-
* @throws {Error} If QVERIS_API_KEY is not set
|
|
139
|
-
*
|
|
140
|
-
* @example
|
|
141
|
-
* ```typescript
|
|
142
|
-
* // Ensure QVERIS_API_KEY is set in your environment
|
|
143
|
-
* const client = createClientFromEnv();
|
|
144
|
-
* ```
|
|
145
|
-
*/
|
|
146
|
-
export declare function createClientFromEnv(): QverisClient;
|
|
147
|
-
//# sourceMappingURL=client.d.ts.map
|
package/dist/api/client.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,kBAAkB,EAEnB,MAAM,aAAa,CAAC;AAKrB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IAEjC;;;;;OAKG;gBACS,MAAM,EAAE,kBAAkB;IAQtC;;;;;;;;OAQG;YACW,OAAO;IA2CrB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACG,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAIlE;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IAI3E;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,WAAW,CACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC;CAI5B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,IAAI,YAAY,CAYlD"}
|
package/dist/api/client.js
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Qveris API HTTP Client
|
|
3
|
-
*
|
|
4
|
-
* Provides a type-safe HTTP client for interacting with the Qveris REST API.
|
|
5
|
-
* Handles authentication, request formatting, and error handling.
|
|
6
|
-
*
|
|
7
|
-
* @module api/client
|
|
8
|
-
*/
|
|
9
|
-
/** Production API base URL */
|
|
10
|
-
const DEFAULT_BASE_URL = 'https://qveris.ai/api/v1';
|
|
11
|
-
/**
|
|
12
|
-
* Qveris API Client
|
|
13
|
-
*
|
|
14
|
-
* A lightweight HTTP client for the Qveris API using native fetch.
|
|
15
|
-
* Requires Node.js 18+ for native fetch support.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```typescript
|
|
19
|
-
* const client = new QverisClient({ apiKey: 'your-api-key' });
|
|
20
|
-
*
|
|
21
|
-
* // Search for tools
|
|
22
|
-
* const searchResult = await client.searchTools({
|
|
23
|
-
* query: 'weather API',
|
|
24
|
-
* limit: 5
|
|
25
|
-
* });
|
|
26
|
-
*
|
|
27
|
-
* // Execute a tool
|
|
28
|
-
* const execResult = await client.executeTool('tool-id', {
|
|
29
|
-
* search_id: searchResult.search_id,
|
|
30
|
-
* parameters: { city: 'London' }
|
|
31
|
-
* });
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
export class QverisClient {
|
|
35
|
-
apiKey;
|
|
36
|
-
baseUrl;
|
|
37
|
-
/**
|
|
38
|
-
* Creates a new Qveris API client.
|
|
39
|
-
*
|
|
40
|
-
* @param config - Client configuration
|
|
41
|
-
* @throws {Error} If apiKey is not provided
|
|
42
|
-
*/
|
|
43
|
-
constructor(config) {
|
|
44
|
-
if (!config.apiKey) {
|
|
45
|
-
throw new Error('Qveris API key is required');
|
|
46
|
-
}
|
|
47
|
-
this.apiKey = config.apiKey;
|
|
48
|
-
this.baseUrl = config.baseUrl ?? DEFAULT_BASE_URL;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Makes an authenticated HTTP request to the Qveris API.
|
|
52
|
-
*
|
|
53
|
-
* @param method - HTTP method
|
|
54
|
-
* @param endpoint - API endpoint (relative to base URL)
|
|
55
|
-
* @param body - Request body (will be JSON serialized)
|
|
56
|
-
* @returns Parsed JSON response
|
|
57
|
-
* @throws {ApiError} If the request fails
|
|
58
|
-
*/
|
|
59
|
-
async request(method, endpoint, body) {
|
|
60
|
-
const url = `${this.baseUrl}${endpoint}`;
|
|
61
|
-
const response = await fetch(url, {
|
|
62
|
-
method,
|
|
63
|
-
headers: {
|
|
64
|
-
'Authorization': `Bearer ${this.apiKey}`,
|
|
65
|
-
'Content-Type': 'application/json',
|
|
66
|
-
},
|
|
67
|
-
body: body ? JSON.stringify(body) : undefined,
|
|
68
|
-
});
|
|
69
|
-
if (!response.ok) {
|
|
70
|
-
let errorMessage;
|
|
71
|
-
let errorDetails;
|
|
72
|
-
try {
|
|
73
|
-
const errorBody = (await response.json());
|
|
74
|
-
errorMessage =
|
|
75
|
-
errorBody.message ||
|
|
76
|
-
errorBody.error ||
|
|
77
|
-
response.statusText;
|
|
78
|
-
errorDetails = errorBody;
|
|
79
|
-
}
|
|
80
|
-
catch {
|
|
81
|
-
errorMessage = response.statusText || `HTTP ${response.status}`;
|
|
82
|
-
}
|
|
83
|
-
const error = {
|
|
84
|
-
status: response.status,
|
|
85
|
-
message: errorMessage,
|
|
86
|
-
details: errorDetails,
|
|
87
|
-
};
|
|
88
|
-
throw error;
|
|
89
|
-
}
|
|
90
|
-
return response.json();
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Search for tools based on a natural language query.
|
|
94
|
-
*
|
|
95
|
-
* Finds tools that match the described capability. Results include
|
|
96
|
-
* tool metadata, parameter schemas, and usage examples.
|
|
97
|
-
*
|
|
98
|
-
* @param request - Search parameters
|
|
99
|
-
* @returns Search results with matching tools
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
* ```typescript
|
|
103
|
-
* const result = await client.searchTools({
|
|
104
|
-
* query: 'send SMS message',
|
|
105
|
-
* limit: 10,
|
|
106
|
-
* session_id: 'abcd1234-ab12-ab12-ab12-abcdef123456'
|
|
107
|
-
* });
|
|
108
|
-
*
|
|
109
|
-
* console.log(`Found ${result.total} tools`);
|
|
110
|
-
* for (const tool of result.results) {
|
|
111
|
-
* console.log(`- ${tool.name}: ${tool.description}`);
|
|
112
|
-
* }
|
|
113
|
-
* ```
|
|
114
|
-
*/
|
|
115
|
-
async searchTools(request) {
|
|
116
|
-
return this.request('POST', '/search', request);
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Get tool descriptions by their IDs.
|
|
120
|
-
*
|
|
121
|
-
* Retrieves detailed information about specific tools when you already
|
|
122
|
-
* know their tool_ids. Useful for refreshing tool metadata or getting
|
|
123
|
-
* details for tools from previous searches.
|
|
124
|
-
*
|
|
125
|
-
* @param request - Request parameters with tool IDs
|
|
126
|
-
* @returns Tool information matching the provided IDs
|
|
127
|
-
*
|
|
128
|
-
* @example
|
|
129
|
-
* ```typescript
|
|
130
|
-
* const result = await client.getToolsByIds({
|
|
131
|
-
* tool_ids: ['weather-tool-1', 'email-tool-2'],
|
|
132
|
-
* search_id: 'abcd1234-ab12-ab12-ab12-abcdef123456',
|
|
133
|
-
* session_id: 'abcd1234-ab12-ab12-ab12-abcdef123456'
|
|
134
|
-
* });
|
|
135
|
-
*
|
|
136
|
-
* console.log(`Retrieved ${result.results.length} tools`);
|
|
137
|
-
* for (const tool of result.results) {
|
|
138
|
-
* console.log(`- ${tool.name}: ${tool.description}`);
|
|
139
|
-
* }
|
|
140
|
-
* ```
|
|
141
|
-
*/
|
|
142
|
-
async getToolsByIds(request) {
|
|
143
|
-
return this.request('POST', '/tools/by-ids', request);
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Execute a tool with the specified parameters.
|
|
147
|
-
*
|
|
148
|
-
* The tool_id must come from a previous searchTools call.
|
|
149
|
-
* The search_id links this execution to that search for analytics.
|
|
150
|
-
*
|
|
151
|
-
* @param toolId - The tool identifier from search results
|
|
152
|
-
* @param request - Execution parameters
|
|
153
|
-
* @returns Execution result
|
|
154
|
-
*
|
|
155
|
-
* @example
|
|
156
|
-
* ```typescript
|
|
157
|
-
* const result = await client.executeTool('openweathermap_current', {
|
|
158
|
-
* search_id: 'abcd1234-ab12-ab12-ab12-abcdef123456',
|
|
159
|
-
* session_id: 'abcd1234-ab12-ab12-ab12-abcdef123456',
|
|
160
|
-
* parameters: {
|
|
161
|
-
* city: 'Tokyo',
|
|
162
|
-
* units: 'metric'
|
|
163
|
-
* }
|
|
164
|
-
* });
|
|
165
|
-
*
|
|
166
|
-
* if (result.success) {
|
|
167
|
-
* console.log('Result:', result.result);
|
|
168
|
-
* } else {
|
|
169
|
-
* console.error('Failed:', result.error_message);
|
|
170
|
-
* }
|
|
171
|
-
* ```
|
|
172
|
-
*/
|
|
173
|
-
async executeTool(toolId, request) {
|
|
174
|
-
const endpoint = `/tools/execute?tool_id=${encodeURIComponent(toolId)}`;
|
|
175
|
-
return this.request('POST', endpoint, request);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Creates a Qveris client from environment variables.
|
|
180
|
-
*
|
|
181
|
-
* Reads the API key from the QVERIS_API_KEY environment variable.
|
|
182
|
-
*
|
|
183
|
-
* @returns Configured Qveris client
|
|
184
|
-
* @throws {Error} If QVERIS_API_KEY is not set
|
|
185
|
-
*
|
|
186
|
-
* @example
|
|
187
|
-
* ```typescript
|
|
188
|
-
* // Ensure QVERIS_API_KEY is set in your environment
|
|
189
|
-
* const client = createClientFromEnv();
|
|
190
|
-
* ```
|
|
191
|
-
*/
|
|
192
|
-
export function createClientFromEnv() {
|
|
193
|
-
const apiKey = process.env.QVERIS_API_KEY;
|
|
194
|
-
if (!apiKey) {
|
|
195
|
-
throw new Error('QVERIS_API_KEY environment variable is required.\n' +
|
|
196
|
-
'Please set it to your Qveris API token.\n' +
|
|
197
|
-
'Contact Qveris to obtain an API token.');
|
|
198
|
-
}
|
|
199
|
-
return new QverisClient({ apiKey });
|
|
200
|
-
}
|
|
201
|
-
//# sourceMappingURL=client.js.map
|
package/dist/api/client.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH,8BAA8B;AAC9B,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAO,YAAY;IACN,MAAM,CAAS;IACf,OAAO,CAAS;IAEjC;;;;;OAKG;IACH,YAAY,MAA0B;QACpC,IAAI,CAAC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aACtB,CAAC;YAEF,MAAM,KAAK,CAAC;QACd,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,EAAgB,CAAC;IACvC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,KAAK,CAAC,WAAW,CAAC,OAAsB;QACtC,OAAO,IAAI,CAAC,OAAO,CAAiB,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,KAAK,CAAC,aAAa,CAAC,OAA6B;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAiB,MAAM,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,KAAK,CAAC,WAAW,CACf,MAAc,EACd,OAAuB;QAEvB,MAAM,QAAQ,GAAG,0BAA0B,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;QACxE,OAAO,IAAI,CAAC,OAAO,CAAkB,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;CACF;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IAE1C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,oDAAoD;YACpD,2CAA2C;YAC3C,wCAAwC,CACzC,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;AACtC,CAAC"}
|
package/dist/tools/execute.d.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* execute_tool MCP Tool Implementation
|
|
3
|
-
*
|
|
4
|
-
* Executes a specific remote tool with provided parameters.
|
|
5
|
-
* The tool_id must come from a previous search_tools call.
|
|
6
|
-
*
|
|
7
|
-
* @module tools/execute
|
|
8
|
-
*/
|
|
9
|
-
import type { QverisClient } from '../api/client.js';
|
|
10
|
-
import type { ExecuteResponse } from '../types.js';
|
|
11
|
-
/**
|
|
12
|
-
* Input parameters for the execute_tool tool.
|
|
13
|
-
*/
|
|
14
|
-
export interface ExecuteToolInput {
|
|
15
|
-
/**
|
|
16
|
-
* The ID of the remote tool to execute.
|
|
17
|
-
* Must be obtained from search_tools results.
|
|
18
|
-
*/
|
|
19
|
-
tool_id: string;
|
|
20
|
-
/**
|
|
21
|
-
* The search_id from the search_tools response that returned this tool.
|
|
22
|
-
* Links the execution to the original search for analytics and billing.
|
|
23
|
-
*/
|
|
24
|
-
search_id: string;
|
|
25
|
-
/**
|
|
26
|
-
* JSON stringified dictionary of parameters to pass to the remote tool.
|
|
27
|
-
* Keys are parameter names, values can be of any type.
|
|
28
|
-
*
|
|
29
|
-
* @example '{"city": "London", "units": "metric"}'
|
|
30
|
-
* @example '{"query": "AI news", "limit": 10}'
|
|
31
|
-
*/
|
|
32
|
-
params_to_tool: string;
|
|
33
|
-
/**
|
|
34
|
-
* Session identifier for tracking user sessions.
|
|
35
|
-
* If not provided, the server will use an auto-generated session ID.
|
|
36
|
-
*/
|
|
37
|
-
session_id?: string;
|
|
38
|
-
/**
|
|
39
|
-
* Maximum size of response data in bytes.
|
|
40
|
-
* If the tool generates data longer than this limit, the response
|
|
41
|
-
* will be truncated and a download URL provided for the full content.
|
|
42
|
-
*
|
|
43
|
-
* @default 20480 (20KB)
|
|
44
|
-
* @minimum -1 (-1 means no limit)
|
|
45
|
-
*/
|
|
46
|
-
max_response_size?: number;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* JSON Schema for the execute_tool tool input.
|
|
50
|
-
* Used by MCP to validate and document the tool parameters.
|
|
51
|
-
*/
|
|
52
|
-
export declare const executeToolSchema: {
|
|
53
|
-
type: "object";
|
|
54
|
-
properties: {
|
|
55
|
-
tool_id: {
|
|
56
|
-
type: string;
|
|
57
|
-
description: string;
|
|
58
|
-
};
|
|
59
|
-
search_id: {
|
|
60
|
-
type: string;
|
|
61
|
-
description: string;
|
|
62
|
-
};
|
|
63
|
-
params_to_tool: {
|
|
64
|
-
type: string;
|
|
65
|
-
description: string;
|
|
66
|
-
};
|
|
67
|
-
session_id: {
|
|
68
|
-
type: string;
|
|
69
|
-
description: string;
|
|
70
|
-
};
|
|
71
|
-
max_response_size: {
|
|
72
|
-
type: string;
|
|
73
|
-
description: string;
|
|
74
|
-
default: number;
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
required: string[];
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* Executes the execute_tool operation.
|
|
81
|
-
*
|
|
82
|
-
* @param client - Initialized Qveris API client
|
|
83
|
-
* @param input - Execution parameters
|
|
84
|
-
* @param defaultSessionId - Fallback session ID if not provided in input
|
|
85
|
-
* @returns Execution result from the tool
|
|
86
|
-
* @throws {Error} If params_to_tool is not valid JSON
|
|
87
|
-
*/
|
|
88
|
-
export declare function executeExecuteTool(client: QverisClient, input: ExecuteToolInput, defaultSessionId: string): Promise<ExecuteResponse>;
|
|
89
|
-
//# sourceMappingURL=execute.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/tools/execute.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;CAqC7B,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,gBAAgB,EACvB,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,eAAe,CAAC,CAoB1B"}
|
package/dist/tools/execute.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* execute_tool MCP Tool Implementation
|
|
3
|
-
*
|
|
4
|
-
* Executes a specific remote tool with provided parameters.
|
|
5
|
-
* The tool_id must come from a previous search_tools call.
|
|
6
|
-
*
|
|
7
|
-
* @module tools/execute
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* JSON Schema for the execute_tool tool input.
|
|
11
|
-
* Used by MCP to validate and document the tool parameters.
|
|
12
|
-
*/
|
|
13
|
-
export const executeToolSchema = {
|
|
14
|
-
type: 'object',
|
|
15
|
-
properties: {
|
|
16
|
-
tool_id: {
|
|
17
|
-
type: 'string',
|
|
18
|
-
description: 'The ID of the remote tool to execute. Must come from a previous search_tools call.',
|
|
19
|
-
},
|
|
20
|
-
search_id: {
|
|
21
|
-
type: 'string',
|
|
22
|
-
description: 'The search_id from the search_tools response that returned this tool. ' +
|
|
23
|
-
'Required for linking execution to the original search.',
|
|
24
|
-
},
|
|
25
|
-
params_to_tool: {
|
|
26
|
-
type: 'string',
|
|
27
|
-
description: 'A JSON stringified dictionary of parameters to pass to the remote tool. ' +
|
|
28
|
-
'Keys are param names and values can be of any type. ' +
|
|
29
|
-
'Example: \'{"city": "London", "units": "metric"}\'',
|
|
30
|
-
},
|
|
31
|
-
session_id: {
|
|
32
|
-
type: 'string',
|
|
33
|
-
description: 'Session identifier for tracking user sessions. ' +
|
|
34
|
-
'If not provided, an auto-generated session ID will be used.',
|
|
35
|
-
},
|
|
36
|
-
max_response_size: {
|
|
37
|
-
type: 'number',
|
|
38
|
-
description: 'Maximum size of response data in bytes. ' +
|
|
39
|
-
'If tool generates data longer than this, it will be truncated and a download URL provided. ' +
|
|
40
|
-
'Use -1 for no limit. Default is 20480 (20KB).',
|
|
41
|
-
default: 20480,
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
required: ['tool_id', 'search_id', 'params_to_tool'],
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Executes the execute_tool operation.
|
|
48
|
-
*
|
|
49
|
-
* @param client - Initialized Qveris API client
|
|
50
|
-
* @param input - Execution parameters
|
|
51
|
-
* @param defaultSessionId - Fallback session ID if not provided in input
|
|
52
|
-
* @returns Execution result from the tool
|
|
53
|
-
* @throws {Error} If params_to_tool is not valid JSON
|
|
54
|
-
*/
|
|
55
|
-
export async function executeExecuteTool(client, input, defaultSessionId) {
|
|
56
|
-
// Parse the JSON parameters
|
|
57
|
-
let parameters;
|
|
58
|
-
try {
|
|
59
|
-
parameters = JSON.parse(input.params_to_tool);
|
|
60
|
-
}
|
|
61
|
-
catch (error) {
|
|
62
|
-
throw new Error(`Invalid JSON in params_to_tool: ${error instanceof Error ? error.message : 'Unknown parse error'}. ` +
|
|
63
|
-
`Received: ${input.params_to_tool}`);
|
|
64
|
-
}
|
|
65
|
-
const response = await client.executeTool(input.tool_id, {
|
|
66
|
-
search_id: input.search_id,
|
|
67
|
-
session_id: input.session_id ?? defaultSessionId,
|
|
68
|
-
parameters,
|
|
69
|
-
max_response_size: input.max_response_size,
|
|
70
|
-
});
|
|
71
|
-
return response;
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=execute.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../src/tools/execute.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA+CH;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,QAAiB;IACvB,UAAU,EA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AiB;KAC3C,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* get_tools_by_ids MCP Tool Implementation
|
|
3
|
-
*
|
|
4
|
-
* Retrieves tool descriptions based on tool IDs.
|
|
5
|
-
* Useful for getting detailed information about specific tools
|
|
6
|
-
* when you already know their tool_ids.
|
|
7
|
-
*
|
|
8
|
-
* @module tools/get-by-ids
|
|
9
|
-
*/
|
|
10
|
-
import type { QverisClient } from '../api/client.js';
|
|
11
|
-
import type { SearchResponse } from '../types.js';
|
|
12
|
-
/**
|
|
13
|
-
* Input parameters for the get_tools_by_ids tool.
|
|
14
|
-
*/
|
|
15
|
-
export interface GetToolsByIdsInput {
|
|
16
|
-
/**
|
|
17
|
-
* Array of tool IDs to retrieve information for.
|
|
18
|
-
* Must be obtained from previous search_tools results.
|
|
19
|
-
*
|
|
20
|
-
* @example ["weather-tool-1", "email-tool-2"]
|
|
21
|
-
*/
|
|
22
|
-
tool_ids: string[];
|
|
23
|
-
/**
|
|
24
|
-
* The search_id from the search_tools response that returned the tool(s).
|
|
25
|
-
* Optional but recommended for analytics and billing.
|
|
26
|
-
*/
|
|
27
|
-
search_id?: string;
|
|
28
|
-
/**
|
|
29
|
-
* Session identifier for tracking user sessions.
|
|
30
|
-
* If not provided, the server will use an auto-generated session ID.
|
|
31
|
-
*/
|
|
32
|
-
session_id?: string;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* JSON Schema for the get_tools_by_ids tool input.
|
|
36
|
-
* Used by MCP to validate and document the tool parameters.
|
|
37
|
-
*/
|
|
38
|
-
export declare const getToolsByIdsSchema: {
|
|
39
|
-
type: "object";
|
|
40
|
-
properties: {
|
|
41
|
-
tool_ids: {
|
|
42
|
-
type: string;
|
|
43
|
-
items: {
|
|
44
|
-
type: string;
|
|
45
|
-
};
|
|
46
|
-
description: string;
|
|
47
|
-
minItems: number;
|
|
48
|
-
};
|
|
49
|
-
search_id: {
|
|
50
|
-
type: string;
|
|
51
|
-
description: string;
|
|
52
|
-
};
|
|
53
|
-
session_id: {
|
|
54
|
-
type: string;
|
|
55
|
-
description: string;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
required: string[];
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Executes the get_tools_by_ids operation.
|
|
62
|
-
*
|
|
63
|
-
* @param client - Initialized Qveris API client
|
|
64
|
-
* @param input - Request parameters with tool IDs
|
|
65
|
-
* @param defaultSessionId - Fallback session ID if not provided in input
|
|
66
|
-
* @returns Tool information for the requested IDs
|
|
67
|
-
*/
|
|
68
|
-
export declare function executeGetToolsByIds(client: QverisClient, input: GetToolsByIdsInput, defaultSessionId: string): Promise<SearchResponse>;
|
|
69
|
-
//# sourceMappingURL=get-by-ids.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-by-ids.d.ts","sourceRoot":"","sources":["../../src/tools/get-by-ids.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;CA2B/B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,kBAAkB,EACzB,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,cAAc,CAAC,CAQzB"}
|
package/dist/tools/get-by-ids.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* get_tools_by_ids MCP Tool Implementation
|
|
3
|
-
*
|
|
4
|
-
* Retrieves tool descriptions based on tool IDs.
|
|
5
|
-
* Useful for getting detailed information about specific tools
|
|
6
|
-
* when you already know their tool_ids.
|
|
7
|
-
*
|
|
8
|
-
* @module tools/get-by-ids
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* JSON Schema for the get_tools_by_ids tool input.
|
|
12
|
-
* Used by MCP to validate and document the tool parameters.
|
|
13
|
-
*/
|
|
14
|
-
export const getToolsByIdsSchema = {
|
|
15
|
-
type: 'object',
|
|
16
|
-
properties: {
|
|
17
|
-
tool_ids: {
|
|
18
|
-
type: 'array',
|
|
19
|
-
items: {
|
|
20
|
-
type: 'string',
|
|
21
|
-
},
|
|
22
|
-
description: 'Array of tool IDs to retrieve information for. ' +
|
|
23
|
-
'These IDs should come from previous search_tools results.',
|
|
24
|
-
minItems: 1,
|
|
25
|
-
},
|
|
26
|
-
search_id: {
|
|
27
|
-
type: 'string',
|
|
28
|
-
description: 'The search_id from the search_tools response that returned the tool(s). ' +
|
|
29
|
-
'Optional but recommended for linking to the original search.',
|
|
30
|
-
},
|
|
31
|
-
session_id: {
|
|
32
|
-
type: 'string',
|
|
33
|
-
description: 'Session identifier for tracking user sessions. ' +
|
|
34
|
-
'If not provided, an auto-generated session ID will be used.',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
required: ['tool_ids'],
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Executes the get_tools_by_ids operation.
|
|
41
|
-
*
|
|
42
|
-
* @param client - Initialized Qveris API client
|
|
43
|
-
* @param input - Request parameters with tool IDs
|
|
44
|
-
* @param defaultSessionId - Fallback session ID if not provided in input
|
|
45
|
-
* @returns Tool information for the requested IDs
|
|
46
|
-
*/
|
|
47
|
-
export async function executeGetToolsByIds(client, input, defaultSessionId) {
|
|
48
|
-
const response = await client.getToolsByIds({
|
|
49
|
-
tool_ids: input.tool_ids,
|
|
50
|
-
search_id: input.search_id,
|
|
51
|
-
session_id: input.session_id ?? defaultSessionId,
|
|
52
|
-
});
|
|
53
|
-
return response;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=get-by-ids.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-by-ids.js","sourceRoot":"","sources":["../../src/tools/get-by-ids.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA8BH;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,QAAiB;IACvB,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;aACf;YACD,WAAW,EACT,iDAAiD;gBACjD,2DAA2D;YAC7D,QAAQ,EAAE,CAAC;SACZ;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,0EAA0E;gBAC1E,8DAA8D;SACjE;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,iDAAiD;gBACjD,6DAA6D;SAChE;KACF;IACD,QAAQ,EAAE,CAAC,UAAU,CAAC;CACvB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAAoB,EACpB,KAAyB,EACzB,gBAAwB;IAExB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC;QAC1C,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,gBAAgB;KACjD,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|