@qverisai/mcp 0.2.0 → 0.3.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 +7 -7
- package/dist/api/client.d.ts +6 -91
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +77 -121
- package/dist/api/client.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/tools/execute.d.ts +5 -4
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/execute.js +18 -10
- package/dist/tools/execute.js.map +1 -1
- package/dist/types.d.ts +61 -61
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -2
- package/dist/types.js.map +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -99,7 +99,7 @@ Execute a discovered tool with specific parameters.
|
|
|
99
99
|
|-----------|------|----------|-------------|
|
|
100
100
|
| `tool_id` | string | ✓ | Tool ID from search results |
|
|
101
101
|
| `search_id` | string | ✓ | Search ID from the search that found this tool |
|
|
102
|
-
| `params_to_tool` |
|
|
102
|
+
| `params_to_tool` | object | ✓ | A dictionary of parameters to pass to the tool |
|
|
103
103
|
| `session_id` | string | | Session identifier (auto-generated if omitted) |
|
|
104
104
|
| `max_response_size` | number | | Max response size in bytes (default: 20480) |
|
|
105
105
|
|
|
@@ -109,7 +109,7 @@ Execute a discovered tool with specific parameters.
|
|
|
109
109
|
{
|
|
110
110
|
"tool_id": "openweathermap.weather.execute.v1",
|
|
111
111
|
"search_id": "abcd1234-ab12-ab12-ab12-abcdef123456",
|
|
112
|
-
"params_to_tool":
|
|
112
|
+
"params_to_tool": {"city": "London", "units": "metric"}
|
|
113
113
|
}
|
|
114
114
|
```
|
|
115
115
|
|
|
@@ -192,14 +192,14 @@ The `full_content_file_url` is valid for 120 minutes.
|
|
|
192
192
|
|
|
193
193
|
```bash
|
|
194
194
|
# Clone the repository
|
|
195
|
-
git clone https://github.com/
|
|
196
|
-
cd
|
|
195
|
+
git clone https://github.com/QVerisAI/QVerisAI.git
|
|
196
|
+
cd QVerisAI/packages/mcp
|
|
197
197
|
|
|
198
198
|
# Install dependencies
|
|
199
199
|
npm install
|
|
200
200
|
|
|
201
201
|
# Build
|
|
202
|
-
npm build
|
|
202
|
+
npm run build
|
|
203
203
|
|
|
204
204
|
# Run locally
|
|
205
205
|
QVERIS_API_KEY=your-key node dist/index.js
|
|
@@ -207,10 +207,10 @@ QVERIS_API_KEY=your-key node dist/index.js
|
|
|
207
207
|
|
|
208
208
|
## License
|
|
209
209
|
|
|
210
|
-
MIT © [QVerisAI](https://github.com/
|
|
210
|
+
MIT © [QVerisAI](https://github.com/QVerisAI)
|
|
211
211
|
|
|
212
212
|
## Support
|
|
213
213
|
|
|
214
|
-
- 🐛 [Issue Tracker](https://github.com/
|
|
214
|
+
- 🐛 [Issue Tracker](https://github.com/QVerisAI/QVerisAI/issues)
|
|
215
215
|
- 💬 Contact: contact@qveris.ai
|
|
216
216
|
|
package/dist/api/client.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Qveris API HTTP Client
|
|
3
3
|
*
|
|
4
4
|
* Provides a type-safe HTTP client for interacting with the Qveris REST API.
|
|
5
|
-
* Handles authentication, request formatting, and error handling.
|
|
5
|
+
* Handles authentication, request formatting, timeouts, and error handling.
|
|
6
6
|
*
|
|
7
7
|
* @module api/client
|
|
8
8
|
*/
|
|
@@ -17,13 +17,11 @@ import type { SearchRequest, SearchResponse, GetToolsByIdsRequest, ExecuteReques
|
|
|
17
17
|
* ```typescript
|
|
18
18
|
* const client = new QverisClient({ apiKey: 'your-api-key' });
|
|
19
19
|
*
|
|
20
|
-
* // Search for tools
|
|
21
20
|
* const searchResult = await client.searchTools({
|
|
22
21
|
* query: 'weather API',
|
|
23
22
|
* limit: 5
|
|
24
23
|
* });
|
|
25
24
|
*
|
|
26
|
-
* // Execute a tool
|
|
27
25
|
* const execResult = await client.executeTool('tool-id', {
|
|
28
26
|
* search_id: searchResult.search_id,
|
|
29
27
|
* parameters: { city: 'London' }
|
|
@@ -33,115 +31,32 @@ import type { SearchRequest, SearchResponse, GetToolsByIdsRequest, ExecuteReques
|
|
|
33
31
|
export declare class QverisClient {
|
|
34
32
|
private readonly apiKey;
|
|
35
33
|
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
|
-
*/
|
|
34
|
+
private readonly defaultTimeoutMs;
|
|
42
35
|
constructor(config: QverisClientConfig);
|
|
43
36
|
/**
|
|
44
37
|
* 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
38
|
*/
|
|
52
39
|
private request;
|
|
53
40
|
/**
|
|
54
41
|
* 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
|
-
* ```
|
|
42
|
+
* This is the Discover action and is free.
|
|
75
43
|
*/
|
|
76
44
|
searchTools(request: SearchRequest): Promise<SearchResponse>;
|
|
77
45
|
/**
|
|
78
46
|
* 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
|
-
* ```
|
|
47
|
+
* This is the Inspect action and is free.
|
|
100
48
|
*/
|
|
101
49
|
getToolsByIds(request: GetToolsByIdsRequest): Promise<SearchResponse>;
|
|
102
50
|
/**
|
|
103
51
|
* Execute a tool with the specified parameters.
|
|
104
|
-
*
|
|
105
|
-
*
|
|
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
|
-
* ```
|
|
52
|
+
* This is the Call action and costs 1-100 credits per call.
|
|
53
|
+
* Uses a longer timeout (120s) by default.
|
|
129
54
|
*/
|
|
130
55
|
executeTool(toolId: string, request: ExecuteRequest): Promise<ExecuteResponse>;
|
|
131
56
|
}
|
|
132
57
|
/**
|
|
133
58
|
* Creates a Qveris client from environment variables.
|
|
134
|
-
*
|
|
135
59
|
* 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
60
|
*/
|
|
146
61
|
export declare function createClientFromEnv(): QverisClient;
|
|
147
62
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/api/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AASrB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;gBAE9B,MAAM,EAAE,kBAAkB;IAUtC;;OAEG;YACW,OAAO;IAkFrB;;;OAGG;IACG,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAIlE;;;OAGG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IAI3E;;;;OAIG;IACG,WAAW,CACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC;CAS5B;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,YAAY,CAWlD"}
|
package/dist/api/client.js
CHANGED
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
* Qveris API HTTP Client
|
|
3
3
|
*
|
|
4
4
|
* Provides a type-safe HTTP client for interacting with the Qveris REST API.
|
|
5
|
-
* Handles authentication, request formatting, and error handling.
|
|
5
|
+
* Handles authentication, request formatting, timeouts, and error handling.
|
|
6
6
|
*
|
|
7
7
|
* @module api/client
|
|
8
8
|
*/
|
|
9
9
|
/** Production API base URL */
|
|
10
10
|
const DEFAULT_BASE_URL = 'https://qveris.ai/api/v1';
|
|
11
|
+
/** Default timeout: 30s for search/inspect, 120s for execute */
|
|
12
|
+
const DEFAULT_TIMEOUT_MS = 30_000;
|
|
13
|
+
const EXECUTE_TIMEOUT_MS = 120_000;
|
|
11
14
|
/**
|
|
12
15
|
* Qveris API Client
|
|
13
16
|
*
|
|
@@ -18,13 +21,11 @@ const DEFAULT_BASE_URL = 'https://qveris.ai/api/v1';
|
|
|
18
21
|
* ```typescript
|
|
19
22
|
* const client = new QverisClient({ apiKey: 'your-api-key' });
|
|
20
23
|
*
|
|
21
|
-
* // Search for tools
|
|
22
24
|
* const searchResult = await client.searchTools({
|
|
23
25
|
* query: 'weather API',
|
|
24
26
|
* limit: 5
|
|
25
27
|
* });
|
|
26
28
|
*
|
|
27
|
-
* // Execute a tool
|
|
28
29
|
* const execResult = await client.executeTool('tool-id', {
|
|
29
30
|
* search_id: searchResult.search_id,
|
|
30
31
|
* parameters: { city: 'London' }
|
|
@@ -34,167 +35,122 @@ const DEFAULT_BASE_URL = 'https://qveris.ai/api/v1';
|
|
|
34
35
|
export class QverisClient {
|
|
35
36
|
apiKey;
|
|
36
37
|
baseUrl;
|
|
37
|
-
|
|
38
|
-
* Creates a new Qveris API client.
|
|
39
|
-
*
|
|
40
|
-
* @param config - Client configuration
|
|
41
|
-
* @throws {Error} If apiKey is not provided
|
|
42
|
-
*/
|
|
38
|
+
defaultTimeoutMs;
|
|
43
39
|
constructor(config) {
|
|
44
40
|
if (!config.apiKey) {
|
|
45
41
|
throw new Error('Qveris API key is required');
|
|
46
42
|
}
|
|
47
43
|
this.apiKey = config.apiKey;
|
|
48
|
-
|
|
44
|
+
// Normalize: strip trailing slash to prevent double-slash URLs
|
|
45
|
+
this.baseUrl = (config.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, '');
|
|
46
|
+
this.defaultTimeoutMs = config.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
49
47
|
}
|
|
50
48
|
/**
|
|
51
49
|
* 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
50
|
*/
|
|
59
|
-
async request(method, endpoint, body) {
|
|
51
|
+
async request(method, endpoint, body, timeoutMs) {
|
|
60
52
|
const url = `${this.baseUrl}${endpoint}`;
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
53
|
+
const controller = new AbortController();
|
|
54
|
+
const timeout = setTimeout(() => controller.abort(), timeoutMs ?? this.defaultTimeoutMs);
|
|
55
|
+
try {
|
|
56
|
+
const response = await fetch(url, {
|
|
57
|
+
method,
|
|
58
|
+
headers: {
|
|
59
|
+
'Authorization': `Bearer ${this.apiKey}`,
|
|
60
|
+
'Content-Type': 'application/json',
|
|
61
|
+
},
|
|
62
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
63
|
+
signal: controller.signal,
|
|
64
|
+
});
|
|
65
|
+
if (!response.ok) {
|
|
66
|
+
const status = response.status;
|
|
67
|
+
let errorMessage;
|
|
68
|
+
let errorDetails;
|
|
69
|
+
try {
|
|
70
|
+
const errorBody = (await response.json());
|
|
71
|
+
errorMessage =
|
|
72
|
+
errorBody.error_message ||
|
|
73
|
+
errorBody.message ||
|
|
74
|
+
errorBody.error ||
|
|
75
|
+
response.statusText;
|
|
76
|
+
errorDetails = errorBody;
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
errorMessage = response.statusText || `HTTP ${status}`;
|
|
80
|
+
}
|
|
81
|
+
// Provide actionable hints for specific status codes
|
|
82
|
+
if (status === 402) {
|
|
83
|
+
errorMessage = `Insufficient credits. ${errorMessage}. Purchase credits at https://qveris.ai/pricing`;
|
|
84
|
+
}
|
|
85
|
+
const error = {
|
|
86
|
+
status,
|
|
87
|
+
message: errorMessage,
|
|
88
|
+
details: errorDetails,
|
|
89
|
+
};
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
72
92
|
try {
|
|
73
|
-
|
|
74
|
-
errorMessage =
|
|
75
|
-
errorBody.message ||
|
|
76
|
-
errorBody.error ||
|
|
77
|
-
response.statusText;
|
|
78
|
-
errorDetails = errorBody;
|
|
93
|
+
return await response.json();
|
|
79
94
|
}
|
|
80
95
|
catch {
|
|
81
|
-
|
|
96
|
+
const error = {
|
|
97
|
+
status: response.status,
|
|
98
|
+
message: 'Invalid or empty JSON response from API',
|
|
99
|
+
};
|
|
100
|
+
throw error;
|
|
82
101
|
}
|
|
83
|
-
const error = {
|
|
84
|
-
status: response.status,
|
|
85
|
-
message: errorMessage,
|
|
86
|
-
details: errorDetails,
|
|
87
|
-
};
|
|
88
|
-
throw error;
|
|
89
102
|
}
|
|
90
|
-
|
|
103
|
+
catch (err) {
|
|
104
|
+
if (err && typeof err === 'object' && 'status' in err) {
|
|
105
|
+
// ApiError — rethrow as-is
|
|
106
|
+
throw err;
|
|
107
|
+
}
|
|
108
|
+
if (err instanceof Error && err.name === 'AbortError') {
|
|
109
|
+
const error = {
|
|
110
|
+
status: 408,
|
|
111
|
+
message: 'Request timed out. Check connectivity or increase timeout.',
|
|
112
|
+
};
|
|
113
|
+
throw error;
|
|
114
|
+
}
|
|
115
|
+
throw err;
|
|
116
|
+
}
|
|
117
|
+
finally {
|
|
118
|
+
clearTimeout(timeout);
|
|
119
|
+
}
|
|
91
120
|
}
|
|
92
121
|
/**
|
|
93
122
|
* 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
|
-
* ```
|
|
123
|
+
* This is the Discover action and is free.
|
|
114
124
|
*/
|
|
115
125
|
async searchTools(request) {
|
|
116
126
|
return this.request('POST', '/search', request);
|
|
117
127
|
}
|
|
118
128
|
/**
|
|
119
129
|
* 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
|
-
* ```
|
|
130
|
+
* This is the Inspect action and is free.
|
|
141
131
|
*/
|
|
142
132
|
async getToolsByIds(request) {
|
|
143
133
|
return this.request('POST', '/tools/by-ids', request);
|
|
144
134
|
}
|
|
145
135
|
/**
|
|
146
136
|
* Execute a tool with the specified parameters.
|
|
147
|
-
*
|
|
148
|
-
*
|
|
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
|
-
* ```
|
|
137
|
+
* This is the Call action and costs 1-100 credits per call.
|
|
138
|
+
* Uses a longer timeout (120s) by default.
|
|
172
139
|
*/
|
|
173
140
|
async executeTool(toolId, request) {
|
|
174
141
|
const endpoint = `/tools/execute?tool_id=${encodeURIComponent(toolId)}`;
|
|
175
|
-
return this.request('POST', endpoint, request);
|
|
142
|
+
return this.request('POST', endpoint, request, EXECUTE_TIMEOUT_MS);
|
|
176
143
|
}
|
|
177
144
|
}
|
|
178
145
|
/**
|
|
179
146
|
* Creates a Qveris client from environment variables.
|
|
180
|
-
*
|
|
181
147
|
* 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
148
|
*/
|
|
192
149
|
export function createClientFromEnv() {
|
|
193
150
|
const apiKey = process.env.QVERIS_API_KEY;
|
|
194
151
|
if (!apiKey) {
|
|
195
152
|
throw new Error('QVERIS_API_KEY environment variable is required.\n' +
|
|
196
|
-
'
|
|
197
|
-
'Contact Qveris to obtain an API token.');
|
|
153
|
+
'Get your API key at https://qveris.ai/account?page=api-keys');
|
|
198
154
|
}
|
|
199
155
|
return new QverisClient({ apiKey });
|
|
200
156
|
}
|
package/dist/api/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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,gEAAgE;AAChE,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAClC,MAAM,kBAAkB,GAAG,OAAO,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,YAAY;IACN,MAAM,CAAS;IACf,OAAO,CAAS;IAChB,gBAAgB,CAAS;IAE1C,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,+DAA+D;QAC/D,IAAI,CAAC,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,gBAAgB,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACxE,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,SAAS,IAAI,kBAAkB,CAAC;IACjE,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,OAAO,CACnB,MAAsB,EACtB,QAAgB,EAChB,IAAc,EACd,SAAkB;QAElB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,QAAQ,EAAE,CAAC;QACzC,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;QACzC,MAAM,OAAO,GAAG,UAAU,CACxB,GAAG,EAAE,CAAC,UAAU,CAAC,KAA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AmB;IACjC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IAE1C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,oDAAoD;YACpD,6DAA6D,CAC9D,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;AACtC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -105,7 +105,7 @@ async function main() {
|
|
|
105
105
|
const { name, arguments: args } = request.params;
|
|
106
106
|
try {
|
|
107
107
|
if (name === 'search_tools') {
|
|
108
|
-
const input = args;
|
|
108
|
+
const input = (args ?? {});
|
|
109
109
|
// Validate required fields
|
|
110
110
|
if (!input.query || typeof input.query !== 'string') {
|
|
111
111
|
return {
|
|
@@ -132,7 +132,7 @@ async function main() {
|
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
134
|
if (name === 'get_tools_by_ids') {
|
|
135
|
-
const input = args;
|
|
135
|
+
const input = (args ?? {});
|
|
136
136
|
// Validate required fields
|
|
137
137
|
if (!input.tool_ids || !Array.isArray(input.tool_ids) || input.tool_ids.length === 0) {
|
|
138
138
|
return {
|
|
@@ -159,7 +159,7 @@ async function main() {
|
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
161
|
if (name === 'execute_tool') {
|
|
162
|
-
const input = args;
|
|
162
|
+
const input = (args ?? {});
|
|
163
163
|
// Validate required fields
|
|
164
164
|
const missingFields = [];
|
|
165
165
|
if (!input.tool_id)
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sB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,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO;gBACrB,CAAC,CAAC,SAAS,CAAC;YAEd,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;4BACnB,KAAK,EAAE,YAAY;4BACnB,GAAG,CAAC,UAAU,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;yBACzC,CAAC;qBACH;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,4EAA4E;IAC5E,eAAe;IACf,4EAA4E;IAE5E,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,8DAA8D;IAC9D,OAAO,CAAC,KAAK,CAAC,sBAAsB,cAAc,UAAU,CAAC,CAAC;IAC9D,OAAO,CAAC,KAAK,CAAC,eAAe,gBAAgB,EAAE,CAAC,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,SAAS,UAAU,CAAC,KAAc;IAChC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,QAAQ,IAAI,KAAK;QACjB,SAAS,IAAI,KAAK,CACnB,CAAC;AACJ,CAAC;AAED,iBAAiB;AACjB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/tools/execute.d.ts
CHANGED
|
@@ -23,13 +23,14 @@ export interface ExecuteToolInput {
|
|
|
23
23
|
*/
|
|
24
24
|
search_id: string;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Dictionary of parameters to pass to the remote tool.
|
|
27
27
|
* Keys are parameter names, values can be of any type.
|
|
28
|
+
* Can be provided as an object directly or as a JSON string (legacy).
|
|
28
29
|
*
|
|
29
|
-
* @example
|
|
30
|
-
* @example
|
|
30
|
+
* @example {"city": "London", "units": "metric"}
|
|
31
|
+
* @example {"query": "AI news", "limit": 10}
|
|
31
32
|
*/
|
|
32
|
-
params_to_tool: string;
|
|
33
|
+
params_to_tool: Record<string, unknown> | string;
|
|
33
34
|
/**
|
|
34
35
|
* Session identifier for tracking user sessions.
|
|
35
36
|
* If not provided, the server will use an auto-generated session ID.
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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;;;;;;;OAOG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IAEjD;;;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,CA0B1B"}
|
package/dist/tools/execute.js
CHANGED
|
@@ -23,10 +23,10 @@ export const executeToolSchema = {
|
|
|
23
23
|
'Required for linking execution to the original search.',
|
|
24
24
|
},
|
|
25
25
|
params_to_tool: {
|
|
26
|
-
type: '
|
|
27
|
-
description: 'A
|
|
26
|
+
type: 'object',
|
|
27
|
+
description: 'A dictionary of parameters to pass to the remote tool. ' +
|
|
28
28
|
'Keys are param names and values can be of any type. ' +
|
|
29
|
-
'Example:
|
|
29
|
+
'Example: {"city": "London", "units": "metric"}',
|
|
30
30
|
},
|
|
31
31
|
session_id: {
|
|
32
32
|
type: 'string',
|
|
@@ -41,7 +41,7 @@ export const executeToolSchema = {
|
|
|
41
41
|
default: 20480,
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
|
-
required: ['tool_id', 'params_to_tool'],
|
|
44
|
+
required: ['tool_id', 'search_id', 'params_to_tool'],
|
|
45
45
|
};
|
|
46
46
|
/**
|
|
47
47
|
* Executes the execute_tool operation.
|
|
@@ -53,14 +53,22 @@ export const executeToolSchema = {
|
|
|
53
53
|
* @throws {Error} If params_to_tool is not valid JSON
|
|
54
54
|
*/
|
|
55
55
|
export async function executeExecuteTool(client, input, defaultSessionId) {
|
|
56
|
-
//
|
|
56
|
+
// Resolve parameters: accept object directly or JSON string (legacy compat)
|
|
57
57
|
let parameters;
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
if (typeof input.params_to_tool === 'string') {
|
|
59
|
+
try {
|
|
60
|
+
parameters = JSON.parse(input.params_to_tool);
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
throw new Error(`Invalid JSON in params_to_tool: ${error instanceof Error ? error.message : 'Unknown parse error'}. ` +
|
|
64
|
+
`Received: ${input.params_to_tool}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else if (typeof input.params_to_tool === 'object' && input.params_to_tool !== null) {
|
|
68
|
+
parameters = input.params_to_tool;
|
|
60
69
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
`Received: ${input.params_to_tool}`);
|
|
70
|
+
else {
|
|
71
|
+
parameters = {};
|
|
64
72
|
}
|
|
65
73
|
const response = await client.executeTool(input.tool_id, {
|
|
66
74
|
search_id: input.search_id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../src/tools/execute.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../src/tools/execute.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAgDH;;;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,yDAAyD;gBACzD,sDAAsD;gBACtD,gDAAgD;SACnD;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,4EAA4E;IAC5E,IAAI,UAAmC,CAAC;IACxC,IAAI,OAAO,KAAK,CAAC,cAAc,KAAK,QAAQ,EAAE,CAAC;QAC7C,IAAI,CAAC;YACH,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,CAA4B,CAAC;QAC3E,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CACb,mCAAmC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,qBAAqB,IAAI;gBACrG,aAAa,KAAK,CAAC,cAAc,EAAE,CACpC,CAAC;QACJ,CAAC;IACH,CAAC;SAAM,IAAI,OAAO,KAAK,CAAC,cAAc,KAAK,QAAQ,IAAI,KAAK,CAAC,cAAc,KAAK,IAAI,EAAE,CAAC;QACrF,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC;IACpC,CAAC;SAAM,CAAC;QACN,UAAU,GAAG,EAAE,CAAC;IAClB,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/types.d.ts
CHANGED
|
@@ -1,30 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Qveris API Type Definitions
|
|
3
3
|
*
|
|
4
|
-
* This module contains TypeScript types that match the Qveris API
|
|
5
|
-
*
|
|
4
|
+
* This module contains TypeScript types that match the Qveris API schema.
|
|
5
|
+
* Aligned with backend ToolInfo, SearchResponse, ToolCallResponse, and
|
|
6
|
+
* the REST API documentation at docs/en-US/rest-api.md.
|
|
6
7
|
*
|
|
7
8
|
* @module types
|
|
8
9
|
* @see {@link https://qveris.ai/api/v1} Qveris API Base URL
|
|
9
10
|
*/
|
|
10
11
|
/**
|
|
11
12
|
* 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
13
|
*/
|
|
22
14
|
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
|
-
*/
|
|
15
|
+
/** Natural language search query describing the tool capability you need. */
|
|
28
16
|
query: string;
|
|
29
17
|
/**
|
|
30
18
|
* Maximum number of results to return.
|
|
@@ -33,15 +21,11 @@ export interface SearchRequest {
|
|
|
33
21
|
* @maximum 100
|
|
34
22
|
*/
|
|
35
23
|
limit?: number;
|
|
36
|
-
/**
|
|
37
|
-
* Session identifier for tracking user sessions.
|
|
38
|
-
* Same ID corresponds to the same user session.
|
|
39
|
-
*/
|
|
24
|
+
/** Session identifier for tracking user sessions. */
|
|
40
25
|
session_id?: string;
|
|
41
26
|
}
|
|
42
27
|
/**
|
|
43
28
|
* Parameter definition for a tool.
|
|
44
|
-
* Describes a single input parameter that a tool accepts.
|
|
45
29
|
*/
|
|
46
30
|
export interface ToolParameter {
|
|
47
31
|
/** Parameter name (used as key in the parameters object) */
|
|
@@ -62,6 +46,17 @@ export interface ToolExamples {
|
|
|
62
46
|
/** Sample parameter values demonstrating typical usage */
|
|
63
47
|
sample_parameters?: Record<string, unknown>;
|
|
64
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Historical execution performance statistics for a tool.
|
|
51
|
+
*/
|
|
52
|
+
export interface ToolStats {
|
|
53
|
+
/** Historical average execution time in milliseconds */
|
|
54
|
+
avg_execution_time_ms?: number;
|
|
55
|
+
/** Historical success rate (0.0 - 1.0) */
|
|
56
|
+
success_rate?: number;
|
|
57
|
+
/** Estimated cost in credits per call */
|
|
58
|
+
cost?: number;
|
|
59
|
+
}
|
|
65
60
|
/**
|
|
66
61
|
* Information about a tool returned from search results.
|
|
67
62
|
* Contains everything needed to understand and execute the tool.
|
|
@@ -73,30 +68,48 @@ export interface ToolInfo {
|
|
|
73
68
|
name: string;
|
|
74
69
|
/** Detailed description of what the tool does */
|
|
75
70
|
description: string;
|
|
71
|
+
/** Tool categories/tags */
|
|
72
|
+
categories?: string[];
|
|
76
73
|
/** Name of the organization/service providing this tool */
|
|
77
74
|
provider_name?: string;
|
|
78
75
|
/** Description of the provider */
|
|
79
76
|
provider_description?: string;
|
|
77
|
+
/** Provider website URL */
|
|
78
|
+
provider_website_url?: string;
|
|
80
79
|
/**
|
|
81
80
|
* Geographic availability of the tool.
|
|
82
81
|
* - "global" - Available worldwide
|
|
83
82
|
* - "US|CA" - Whitelist: only available in US and Canada
|
|
84
|
-
* - "
|
|
83
|
+
* - "-CN|RU" - Blacklist: not available in China and Russia
|
|
85
84
|
*/
|
|
86
85
|
region?: string;
|
|
87
|
-
/** Average response latency in milliseconds */
|
|
88
|
-
avg_latency_ms?: number;
|
|
89
86
|
/** List of parameters the tool accepts */
|
|
90
87
|
params?: ToolParameter[];
|
|
91
88
|
/** Usage examples with sample parameters */
|
|
92
89
|
examples?: ToolExamples;
|
|
90
|
+
/** Historical execution performance statistics */
|
|
91
|
+
stats?: ToolStats;
|
|
92
|
+
/** Relevance score for the search query (0.0 - 1.0, higher = better match) */
|
|
93
|
+
final_score?: number;
|
|
94
|
+
/** Whether this tool has been executed before (verified in production) */
|
|
95
|
+
has_last_execution?: boolean;
|
|
96
|
+
/** Most recent execution record, if available */
|
|
97
|
+
last_execution_record?: Record<string, unknown>;
|
|
98
|
+
/** Documentation URL for the tool */
|
|
99
|
+
docs_url?: string;
|
|
100
|
+
/** Protocol type */
|
|
101
|
+
protocol?: string;
|
|
93
102
|
}
|
|
94
103
|
/**
|
|
95
104
|
* Performance statistics for a search operation.
|
|
96
105
|
*/
|
|
97
106
|
export interface SearchStats {
|
|
98
107
|
/** Total time to complete the search in milliseconds */
|
|
99
|
-
search_time_ms
|
|
108
|
+
search_time_ms?: number;
|
|
109
|
+
/** Vector recall count */
|
|
110
|
+
vector_recall_count?: number;
|
|
111
|
+
/** Fulltext recall count */
|
|
112
|
+
fulltext_recall_count?: number;
|
|
100
113
|
}
|
|
101
114
|
/**
|
|
102
115
|
* Response from the Search Tools API.
|
|
@@ -115,58 +128,32 @@ export interface SearchResponse {
|
|
|
115
128
|
results: ToolInfo[];
|
|
116
129
|
/** Search performance statistics */
|
|
117
130
|
stats?: SearchStats;
|
|
131
|
+
/** User's remaining credits after this operation */
|
|
132
|
+
remaining_credits?: number;
|
|
133
|
+
/** Total elapsed time in milliseconds */
|
|
134
|
+
elapsed_time_ms?: number;
|
|
118
135
|
}
|
|
119
136
|
/**
|
|
120
137
|
* 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
138
|
*/
|
|
131
139
|
export interface GetToolsByIdsRequest {
|
|
132
|
-
/**
|
|
133
|
-
* Array of tool IDs to retrieve information for.
|
|
134
|
-
*/
|
|
140
|
+
/** Array of tool IDs to retrieve information for. */
|
|
135
141
|
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
|
-
*/
|
|
142
|
+
/** The search_id from the search that returned the tool(s). */
|
|
140
143
|
search_id?: string;
|
|
141
|
-
/**
|
|
142
|
-
* Session identifier for tracking user sessions.
|
|
143
|
-
* Same ID corresponds to the same user session.
|
|
144
|
-
*/
|
|
144
|
+
/** Session identifier for tracking user sessions. */
|
|
145
145
|
session_id?: string;
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
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
149
|
*/
|
|
160
150
|
export interface ExecuteRequest {
|
|
161
151
|
/**
|
|
162
152
|
* The search_id from the search that returned this tool.
|
|
163
|
-
* Links the execution to the original search for analytics.
|
|
153
|
+
* Links the execution to the original search for analytics and billing.
|
|
164
154
|
*/
|
|
165
155
|
search_id: string;
|
|
166
|
-
/**
|
|
167
|
-
* Session identifier for tracking user sessions.
|
|
168
|
-
* Same ID corresponds to the same user session.
|
|
169
|
-
*/
|
|
156
|
+
/** Session identifier for tracking user sessions. */
|
|
170
157
|
session_id?: string;
|
|
171
158
|
/**
|
|
172
159
|
* Key-value pairs of parameters to pass to the tool.
|
|
@@ -206,6 +193,11 @@ export interface ExecuteResultTruncated {
|
|
|
206
193
|
* Useful for previewing the data structure.
|
|
207
194
|
*/
|
|
208
195
|
truncated_content: string;
|
|
196
|
+
/**
|
|
197
|
+
* JSON Schema describing the structure of the full content.
|
|
198
|
+
* Helps the agent understand the data shape without downloading.
|
|
199
|
+
*/
|
|
200
|
+
content_schema?: Record<string, unknown>;
|
|
209
201
|
}
|
|
210
202
|
/**
|
|
211
203
|
* Union type for execution results (either full data or truncated).
|
|
@@ -235,8 +227,14 @@ export interface ExecuteResponse {
|
|
|
235
227
|
error_message?: string | null;
|
|
236
228
|
/** Execution duration in seconds */
|
|
237
229
|
execution_time?: number;
|
|
230
|
+
/** Execution duration in milliseconds (alternative field) */
|
|
231
|
+
elapsed_time_ms?: number;
|
|
232
|
+
/** Credits consumed by this execution */
|
|
233
|
+
cost?: number;
|
|
234
|
+
/** User's remaining credits after this execution */
|
|
235
|
+
remaining_credits?: number;
|
|
238
236
|
/** Timestamp of execution (ISO 8601 format) */
|
|
239
|
-
created_at
|
|
237
|
+
created_at?: string;
|
|
240
238
|
}
|
|
241
239
|
/**
|
|
242
240
|
* Configuration options for the Qveris API client.
|
|
@@ -246,6 +244,8 @@ export interface QverisClientConfig {
|
|
|
246
244
|
apiKey: string;
|
|
247
245
|
/** Base URL for the API (defaults to production) */
|
|
248
246
|
baseUrl?: string;
|
|
247
|
+
/** Default request timeout in milliseconds */
|
|
248
|
+
timeoutMs?: number;
|
|
249
249
|
}
|
|
250
250
|
/**
|
|
251
251
|
* Error response from the Qveris API.
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5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/B,MAAM,EAAE,MAAM,CAAC;IAEf,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;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
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Qveris API Type Definitions
|
|
3
3
|
*
|
|
4
|
-
* This module contains TypeScript types that match the Qveris API
|
|
5
|
-
*
|
|
4
|
+
* This module contains TypeScript types that match the Qveris API schema.
|
|
5
|
+
* Aligned with backend ToolInfo, SearchResponse, ToolCallResponse, and
|
|
6
|
+
* the REST API documentation at docs/en-US/rest-api.md.
|
|
6
7
|
*
|
|
7
8
|
* @module types
|
|
8
9
|
* @see {@link https://qveris.ai/api/v1} Qveris API Base URL
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qverisai/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Official QVeris AI MCP Server SDK - Search and execute tools via natural language",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"qveris",
|
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
17
|
-
"url": "https://github.com/
|
|
17
|
+
"url": "https://github.com/QVerisAI/QVerisAI",
|
|
18
|
+
"directory": "packages/mcp"
|
|
18
19
|
},
|
|
19
|
-
"homepage": "https://
|
|
20
|
+
"homepage": "https://qveris.ai",
|
|
20
21
|
"bugs": {
|
|
21
|
-
"url": "https://github.com/
|
|
22
|
+
"url": "https://github.com/QVerisAI/QVerisAI/issues"
|
|
22
23
|
},
|
|
23
24
|
"type": "module",
|
|
24
25
|
"main": "dist/index.js",
|