@qverisai/sdk 0.1.1 → 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 -206
- 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 -225
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +268 -42
- 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 -122
- package/dist/api/client.d.ts.map +0 -1
- package/dist/api/client.js +0 -174
- 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/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,122 +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, 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: 'user-123'
|
|
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
|
-
* Execute a tool with the specified parameters.
|
|
79
|
-
*
|
|
80
|
-
* The tool_id must come from a previous searchTools call.
|
|
81
|
-
* The search_id links this execution to that search for analytics.
|
|
82
|
-
*
|
|
83
|
-
* @param toolId - The tool identifier from search results
|
|
84
|
-
* @param request - Execution parameters
|
|
85
|
-
* @returns Execution result
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```typescript
|
|
89
|
-
* const result = await client.executeTool('openweathermap_current', {
|
|
90
|
-
* search_id: 'search-abc123',
|
|
91
|
-
* session_id: 'user-123',
|
|
92
|
-
* parameters: {
|
|
93
|
-
* city: 'Tokyo',
|
|
94
|
-
* units: 'metric'
|
|
95
|
-
* }
|
|
96
|
-
* });
|
|
97
|
-
*
|
|
98
|
-
* if (result.success) {
|
|
99
|
-
* console.log('Result:', result.result);
|
|
100
|
-
* } else {
|
|
101
|
-
* console.error('Failed:', result.error_message);
|
|
102
|
-
* }
|
|
103
|
-
* ```
|
|
104
|
-
*/
|
|
105
|
-
executeTool(toolId: string, request: ExecuteRequest): Promise<ExecuteResponse>;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Creates a Qveris client from environment variables.
|
|
109
|
-
*
|
|
110
|
-
* Reads the API key from the QVERIS_API_KEY environment variable.
|
|
111
|
-
*
|
|
112
|
-
* @returns Configured Qveris client
|
|
113
|
-
* @throws {Error} If QVERIS_API_KEY is not set
|
|
114
|
-
*
|
|
115
|
-
* @example
|
|
116
|
-
* ```typescript
|
|
117
|
-
* // Ensure QVERIS_API_KEY is set in your environment
|
|
118
|
-
* const client = createClientFromEnv();
|
|
119
|
-
* ```
|
|
120
|
-
*/
|
|
121
|
-
export declare function createClientFromEnv(): QverisClient;
|
|
122
|
-
//# 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,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;;;;;;;;;;;;;;;;;;;;;;;;;;;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,174 +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: 'user-123'
|
|
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
|
-
* Execute a tool with the specified parameters.
|
|
120
|
-
*
|
|
121
|
-
* The tool_id must come from a previous searchTools call.
|
|
122
|
-
* The search_id links this execution to that search for analytics.
|
|
123
|
-
*
|
|
124
|
-
* @param toolId - The tool identifier from search results
|
|
125
|
-
* @param request - Execution parameters
|
|
126
|
-
* @returns Execution result
|
|
127
|
-
*
|
|
128
|
-
* @example
|
|
129
|
-
* ```typescript
|
|
130
|
-
* const result = await client.executeTool('openweathermap_current', {
|
|
131
|
-
* search_id: 'search-abc123',
|
|
132
|
-
* session_id: 'user-123',
|
|
133
|
-
* parameters: {
|
|
134
|
-
* city: 'Tokyo',
|
|
135
|
-
* units: 'metric'
|
|
136
|
-
* }
|
|
137
|
-
* });
|
|
138
|
-
*
|
|
139
|
-
* if (result.success) {
|
|
140
|
-
* console.log('Result:', result.result);
|
|
141
|
-
* } else {
|
|
142
|
-
* console.error('Failed:', result.error_message);
|
|
143
|
-
* }
|
|
144
|
-
* ```
|
|
145
|
-
*/
|
|
146
|
-
async executeTool(toolId, request) {
|
|
147
|
-
const endpoint = `/tools/execute?tool_id=${encodeURIComponent(toolId)}`;
|
|
148
|
-
return this.request('POST', endpoint, request);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Creates a Qveris client from environment variables.
|
|
153
|
-
*
|
|
154
|
-
* Reads the API key from the QVERIS_API_KEY environment variable.
|
|
155
|
-
*
|
|
156
|
-
* @returns Configured Qveris client
|
|
157
|
-
* @throws {Error} If QVERIS_API_KEY is not set
|
|
158
|
-
*
|
|
159
|
-
* @example
|
|
160
|
-
* ```typescript
|
|
161
|
-
* // Ensure QVERIS_API_KEY is set in your environment
|
|
162
|
-
* const client = createClientFromEnv();
|
|
163
|
-
* ```
|
|
164
|
-
*/
|
|
165
|
-
export function createClientFromEnv() {
|
|
166
|
-
const apiKey = process.env.QVERIS_API_KEY;
|
|
167
|
-
if (!apiKey) {
|
|
168
|
-
throw new Error('QVERIS_API_KEY environment variable is required.\n' +
|
|
169
|
-
'Please set it to your Qveris API token.\n' +
|
|
170
|
-
'Contact Qveris to obtain an API token.');
|
|
171
|
-
}
|
|
172
|
-
return new QverisClient({ apiKey });
|
|
173
|
-
}
|
|
174
|
-
//# 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;AAWH,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,MAAM,CAAC,MAAM,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAChD,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,gBAAgB,CAAC;IACpD,CAAC;IAED;;;;;;;;OAQG;IACK,KAAK,CAAC,OAAO,CACnB,MAAsB,EACtB,QAAgB,EAChB,IAAc;QAEd,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,QAAQ,EAAE,CAAC;QAEzC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAChC,MAAM;YACN,OAAO,EAAE;gBACP,eAAe,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;gBACxC,cAAc,EAAE,kBAAkB;aACnC;YACD,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;SAC9C,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,IAAI,YAAoB,CAAC;YACzB,IAAI,YAAqB,CAAC;YAE1B,IAAI,CAAC;gBACH,MAAM,SAAS,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAA4B,CAAC;gBACrE,YAAY;oBACT,SAAS,CAAC,OAAkB;wBAC5B,SAAS,CAAC,KAAgB;wBAC3B,QAAQ,CAAC,UAAU,CAAC;gBACtB,YAAY,GAAG,SAAS,CAAC;YAC3B,CAAC;YAAC,MAAM,CAAC;gBACP,YAAY,GAAG,QAAQ,CAAC,UAAU,IAAI,QAAQ,QAAQ,CAAC,MAAM,EAAE,CAAC;YAClE,CAAC;YAED,MAAM,KAAK,GAAa;gBACtB,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,OAAO,EAAE,YAAY;gBACrB,OAAO,EAAE,YAAY;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;;;;;;;;;;;;;;;;;;;;;;;;;;;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,EAAE;QACV,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,oFAAoF;SACvF;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,wEAAwE;gBACxE,wDAAwD;SAC3D;QACD,cAAc,EAAE;YACd,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,0EAA0E;gBAC1E,sDAAsD;gBACtD,oDAAoD;SACvD;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,iDAAiD;gBACjD,6DAA6D;SAChE;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,0CAA0C;gBAC1C,6FAA6F;gBAC7F,+CAA+C;YACjD,OAAO,EAAE,KAAK;SACf;KACF;IACD,QAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,gBAAgB,CAAC;CACrD,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,MAAoB,EACpB,KAAuB,EACvB,gBAAwB;IAExB,4BAA4B;IAC5B,IAAI,UAAmC,CAAC;IACxC,IAAI,CAAC;QACH,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,CAA4B,CAAC;IAC3E,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,mCAAmC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,qBAAqB,IAAI;YACrG,aAAa,KAAK,CAAC,cAAc,EAAE,CACpC,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE;QACvD,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,gBAAgB;QAChD,UAAU;QACV,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;KAC3C,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/tools/search.d.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
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
|
-
import type { QverisClient } from '../api/client.js';
|
|
10
|
-
import type { SearchResponse } from '../types.js';
|
|
11
|
-
/**
|
|
12
|
-
* Input parameters for the search_tools tool.
|
|
13
|
-
*/
|
|
14
|
-
export interface SearchToolsInput {
|
|
15
|
-
/**
|
|
16
|
-
* The search query describing the general capability of the tool.
|
|
17
|
-
* Should describe what you want to accomplish, not specific parameters.
|
|
18
|
-
*
|
|
19
|
-
* @example "weather forecast API"
|
|
20
|
-
* @example "send email notification"
|
|
21
|
-
* @example "stock price lookup"
|
|
22
|
-
*/
|
|
23
|
-
query: string;
|
|
24
|
-
/**
|
|
25
|
-
* Maximum number of results to return.
|
|
26
|
-
* @default 20
|
|
27
|
-
* @minimum 1
|
|
28
|
-
* @maximum 100
|
|
29
|
-
*/
|
|
30
|
-
limit?: number;
|
|
31
|
-
/**
|
|
32
|
-
* Session identifier for tracking user sessions.
|
|
33
|
-
* If not provided, the server will use an auto-generated session ID.
|
|
34
|
-
*/
|
|
35
|
-
session_id?: string;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* JSON Schema for the search_tools tool input.
|
|
39
|
-
* Used by MCP to validate and document the tool parameters.
|
|
40
|
-
*/
|
|
41
|
-
export declare const searchToolsSchema: {
|
|
42
|
-
type: "object";
|
|
43
|
-
properties: {
|
|
44
|
-
query: {
|
|
45
|
-
type: string;
|
|
46
|
-
description: string;
|
|
47
|
-
};
|
|
48
|
-
limit: {
|
|
49
|
-
type: string;
|
|
50
|
-
description: string;
|
|
51
|
-
default: number;
|
|
52
|
-
minimum: number;
|
|
53
|
-
maximum: number;
|
|
54
|
-
};
|
|
55
|
-
session_id: {
|
|
56
|
-
type: string;
|
|
57
|
-
description: string;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
required: string[];
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Executes the search_tools operation.
|
|
64
|
-
*
|
|
65
|
-
* @param client - Initialized Qveris API client
|
|
66
|
-
* @param input - Search parameters
|
|
67
|
-
* @param defaultSessionId - Fallback session ID if not provided in input
|
|
68
|
-
* @returns Search results with matching tools
|
|
69
|
-
*/
|
|
70
|
-
export declare function executeSearchTools(client: QverisClient, input: SearchToolsInput, defaultSessionId: string): Promise<SearchResponse>;
|
|
71
|
-
//# sourceMappingURL=search.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;OAOG;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,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;CAyB7B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,gBAAgB,EACvB,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,cAAc,CAAC,CAQzB"}
|
package/dist/tools/search.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
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
|
package/dist/tools/search.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|