@codeqr/ts-mcp 0.6.0 → 0.8.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/code-tool-types.d.mts +2 -0
- package/code-tool-types.d.mts.map +1 -1
- package/code-tool-types.d.ts +2 -0
- package/code-tool-types.d.ts.map +1 -1
- package/code-tool-worker.d.mts.map +1 -1
- package/code-tool-worker.d.ts.map +1 -1
- package/code-tool-worker.js +6 -0
- package/code-tool-worker.js.map +1 -1
- package/code-tool-worker.mjs +6 -0
- package/code-tool-worker.mjs.map +1 -1
- package/code-tool.d.mts.map +1 -1
- package/code-tool.d.ts.map +1 -1
- package/code-tool.js +18 -2
- package/code-tool.js.map +1 -1
- package/code-tool.mjs +18 -2
- package/code-tool.mjs.map +1 -1
- package/docs-search-tool.d.mts.map +1 -1
- package/docs-search-tool.d.ts.map +1 -1
- package/docs-search-tool.js +7 -2
- package/docs-search-tool.js.map +1 -1
- package/docs-search-tool.mjs +7 -2
- package/docs-search-tool.mjs.map +1 -1
- package/filtering.d.mts +1 -0
- package/filtering.d.mts.map +1 -1
- package/filtering.d.ts +1 -0
- package/filtering.d.ts.map +1 -1
- package/filtering.js +4 -0
- package/filtering.js.map +1 -1
- package/filtering.mjs +3 -0
- package/filtering.mjs.map +1 -1
- package/headers.d.mts.map +1 -1
- package/headers.d.ts.map +1 -1
- package/headers.js +1 -1
- package/headers.js.map +1 -1
- package/headers.mjs +1 -1
- package/headers.mjs.map +1 -1
- package/http.js +2 -2
- package/http.js.map +1 -1
- package/http.mjs +2 -2
- package/http.mjs.map +1 -1
- package/package.json +3 -3
- package/server.js +1 -1
- package/server.mjs +1 -1
- package/src/code-tool-types.ts +5 -1
- package/src/code-tool-worker.ts +6 -0
- package/src/code-tool.ts +23 -2
- package/src/docs-search-tool.ts +7 -3
- package/src/filtering.ts +4 -0
- package/src/headers.ts +3 -1
- package/src/http.ts +2 -2
- package/src/server.ts +1 -1
- package/src/tools/analytics/retrieve-analytics.ts +9 -2
- package/src/tools/domains/create-domains.ts +20 -4
- package/src/tools/domains/delete-domains.ts +10 -3
- package/src/tools/domains/list-domains.ts +11 -4
- package/src/tools/domains/update-domains.ts +20 -4
- package/src/tools/events/list-events.ts +9 -2
- package/src/tools/links/bulk/create-links-bulk.ts +9 -2
- package/src/tools/links/bulk/delete-links-bulk.ts +10 -3
- package/src/tools/links/count-links.ts +9 -2
- package/src/tools/links/create-links.ts +9 -2
- package/src/tools/links/delete-links.ts +10 -3
- package/src/tools/links/list-links.ts +9 -2
- package/src/tools/links/retrieve-info-links.ts +10 -3
- package/src/tools/links/update-links.ts +9 -2
- package/src/tools/links/upsert-links.ts +9 -2
- package/src/tools/projects/list-projects.ts +10 -3
- package/src/tools/projects/retrieve-projects.ts +10 -3
- package/src/tools/qrcodes/bulk/create-qrcodes-bulk.ts +9 -2
- package/src/tools/qrcodes/bulk/delete-qrcodes-bulk.ts +10 -3
- package/src/tools/qrcodes/count-qrcodes.ts +10 -3
- package/src/tools/qrcodes/create-qrcodes.ts +9 -2
- package/src/tools/qrcodes/delete-qrcodes.ts +10 -3
- package/src/tools/qrcodes/list-qrcodes.ts +9 -2
- package/src/tools/qrcodes/retrieve-qrcodes.ts +9 -2
- package/src/tools/qrcodes/update-qrcodes.ts +9 -2
- package/src/tools/qrcodes/upsert-qrcodes.ts +9 -2
- package/src/tools/tags/create-tags.ts +10 -3
- package/src/tools/tags/delete-tags.ts +10 -3
- package/src/tools/tags/list-tags.ts +10 -3
- package/src/tools/tags/update-tags.ts +10 -3
- package/src/tools/track/track-lead-track.ts +10 -3
- package/src/tools/track/track-sale-track.ts +10 -3
- package/src/tools/types.ts +12 -0
- package/tools/analytics/retrieve-analytics.d.mts.map +1 -1
- package/tools/analytics/retrieve-analytics.d.ts.map +1 -1
- package/tools/analytics/retrieve-analytics.js +13 -1
- package/tools/analytics/retrieve-analytics.js.map +1 -1
- package/tools/analytics/retrieve-analytics.mjs +11 -2
- package/tools/analytics/retrieve-analytics.mjs.map +1 -1
- package/tools/domains/create-domains.d.mts.map +1 -1
- package/tools/domains/create-domains.d.ts.map +1 -1
- package/tools/domains/create-domains.js +23 -2
- package/tools/domains/create-domains.js.map +1 -1
- package/tools/domains/create-domains.mjs +22 -4
- package/tools/domains/create-domains.mjs.map +1 -1
- package/tools/domains/delete-domains.d.mts.map +1 -1
- package/tools/domains/delete-domains.d.ts.map +1 -1
- package/tools/domains/delete-domains.js +13 -1
- package/tools/domains/delete-domains.js.map +1 -1
- package/tools/domains/delete-domains.mjs +12 -3
- package/tools/domains/delete-domains.mjs.map +1 -1
- package/tools/domains/list-domains.d.mts.map +1 -1
- package/tools/domains/list-domains.d.ts.map +1 -1
- package/tools/domains/list-domains.js +14 -2
- package/tools/domains/list-domains.js.map +1 -1
- package/tools/domains/list-domains.mjs +13 -4
- package/tools/domains/list-domains.mjs.map +1 -1
- package/tools/domains/update-domains.d.mts.map +1 -1
- package/tools/domains/update-domains.d.ts.map +1 -1
- package/tools/domains/update-domains.js +23 -2
- package/tools/domains/update-domains.js.map +1 -1
- package/tools/domains/update-domains.mjs +22 -4
- package/tools/domains/update-domains.mjs.map +1 -1
- package/tools/events/list-events.d.mts.map +1 -1
- package/tools/events/list-events.d.ts.map +1 -1
- package/tools/events/list-events.js +13 -1
- package/tools/events/list-events.js.map +1 -1
- package/tools/events/list-events.mjs +11 -2
- package/tools/events/list-events.mjs.map +1 -1
- package/tools/links/bulk/create-links-bulk.d.mts.map +1 -1
- package/tools/links/bulk/create-links-bulk.d.ts.map +1 -1
- package/tools/links/bulk/create-links-bulk.js +13 -1
- package/tools/links/bulk/create-links-bulk.js.map +1 -1
- package/tools/links/bulk/create-links-bulk.mjs +11 -2
- package/tools/links/bulk/create-links-bulk.mjs.map +1 -1
- package/tools/links/bulk/delete-links-bulk.d.mts.map +1 -1
- package/tools/links/bulk/delete-links-bulk.d.ts.map +1 -1
- package/tools/links/bulk/delete-links-bulk.js +13 -1
- package/tools/links/bulk/delete-links-bulk.js.map +1 -1
- package/tools/links/bulk/delete-links-bulk.mjs +12 -3
- package/tools/links/bulk/delete-links-bulk.mjs.map +1 -1
- package/tools/links/count-links.d.mts.map +1 -1
- package/tools/links/count-links.d.ts.map +1 -1
- package/tools/links/count-links.js +13 -1
- package/tools/links/count-links.js.map +1 -1
- package/tools/links/count-links.mjs +11 -2
- package/tools/links/count-links.mjs.map +1 -1
- package/tools/links/create-links.d.mts.map +1 -1
- package/tools/links/create-links.d.ts.map +1 -1
- package/tools/links/create-links.js +13 -1
- package/tools/links/create-links.js.map +1 -1
- package/tools/links/create-links.mjs +11 -2
- package/tools/links/create-links.mjs.map +1 -1
- package/tools/links/delete-links.d.mts.map +1 -1
- package/tools/links/delete-links.d.ts.map +1 -1
- package/tools/links/delete-links.js +13 -1
- package/tools/links/delete-links.js.map +1 -1
- package/tools/links/delete-links.mjs +12 -3
- package/tools/links/delete-links.mjs.map +1 -1
- package/tools/links/list-links.d.mts.map +1 -1
- package/tools/links/list-links.d.ts.map +1 -1
- package/tools/links/list-links.js +13 -1
- package/tools/links/list-links.js.map +1 -1
- package/tools/links/list-links.mjs +11 -2
- package/tools/links/list-links.mjs.map +1 -1
- package/tools/links/retrieve-info-links.d.mts.map +1 -1
- package/tools/links/retrieve-info-links.d.ts.map +1 -1
- package/tools/links/retrieve-info-links.js +13 -1
- package/tools/links/retrieve-info-links.js.map +1 -1
- package/tools/links/retrieve-info-links.mjs +12 -3
- package/tools/links/retrieve-info-links.mjs.map +1 -1
- package/tools/links/update-links.d.mts.map +1 -1
- package/tools/links/update-links.d.ts.map +1 -1
- package/tools/links/update-links.js +13 -1
- package/tools/links/update-links.js.map +1 -1
- package/tools/links/update-links.mjs +11 -2
- package/tools/links/update-links.mjs.map +1 -1
- package/tools/links/upsert-links.d.mts.map +1 -1
- package/tools/links/upsert-links.d.ts.map +1 -1
- package/tools/links/upsert-links.js +13 -1
- package/tools/links/upsert-links.js.map +1 -1
- package/tools/links/upsert-links.mjs +11 -2
- package/tools/links/upsert-links.mjs.map +1 -1
- package/tools/projects/list-projects.d.mts.map +1 -1
- package/tools/projects/list-projects.d.ts.map +1 -1
- package/tools/projects/list-projects.js +13 -1
- package/tools/projects/list-projects.js.map +1 -1
- package/tools/projects/list-projects.mjs +12 -3
- package/tools/projects/list-projects.mjs.map +1 -1
- package/tools/projects/retrieve-projects.d.mts.map +1 -1
- package/tools/projects/retrieve-projects.d.ts.map +1 -1
- package/tools/projects/retrieve-projects.js +13 -1
- package/tools/projects/retrieve-projects.js.map +1 -1
- package/tools/projects/retrieve-projects.mjs +12 -3
- package/tools/projects/retrieve-projects.mjs.map +1 -1
- package/tools/qrcodes/bulk/create-qrcodes-bulk.d.mts.map +1 -1
- package/tools/qrcodes/bulk/create-qrcodes-bulk.d.ts.map +1 -1
- package/tools/qrcodes/bulk/create-qrcodes-bulk.js +13 -1
- package/tools/qrcodes/bulk/create-qrcodes-bulk.js.map +1 -1
- package/tools/qrcodes/bulk/create-qrcodes-bulk.mjs +11 -2
- package/tools/qrcodes/bulk/create-qrcodes-bulk.mjs.map +1 -1
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.d.mts.map +1 -1
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.d.ts.map +1 -1
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.js +13 -1
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.js.map +1 -1
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.mjs +12 -3
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.mjs.map +1 -1
- package/tools/qrcodes/count-qrcodes.d.mts.map +1 -1
- package/tools/qrcodes/count-qrcodes.d.ts.map +1 -1
- package/tools/qrcodes/count-qrcodes.js +13 -1
- package/tools/qrcodes/count-qrcodes.js.map +1 -1
- package/tools/qrcodes/count-qrcodes.mjs +12 -3
- package/tools/qrcodes/count-qrcodes.mjs.map +1 -1
- package/tools/qrcodes/create-qrcodes.d.mts.map +1 -1
- package/tools/qrcodes/create-qrcodes.d.ts.map +1 -1
- package/tools/qrcodes/create-qrcodes.js +13 -1
- package/tools/qrcodes/create-qrcodes.js.map +1 -1
- package/tools/qrcodes/create-qrcodes.mjs +11 -2
- package/tools/qrcodes/create-qrcodes.mjs.map +1 -1
- package/tools/qrcodes/delete-qrcodes.d.mts.map +1 -1
- package/tools/qrcodes/delete-qrcodes.d.ts.map +1 -1
- package/tools/qrcodes/delete-qrcodes.js +13 -1
- package/tools/qrcodes/delete-qrcodes.js.map +1 -1
- package/tools/qrcodes/delete-qrcodes.mjs +12 -3
- package/tools/qrcodes/delete-qrcodes.mjs.map +1 -1
- package/tools/qrcodes/list-qrcodes.d.mts.map +1 -1
- package/tools/qrcodes/list-qrcodes.d.ts.map +1 -1
- package/tools/qrcodes/list-qrcodes.js +13 -1
- package/tools/qrcodes/list-qrcodes.js.map +1 -1
- package/tools/qrcodes/list-qrcodes.mjs +11 -2
- package/tools/qrcodes/list-qrcodes.mjs.map +1 -1
- package/tools/qrcodes/retrieve-qrcodes.d.mts.map +1 -1
- package/tools/qrcodes/retrieve-qrcodes.d.ts.map +1 -1
- package/tools/qrcodes/retrieve-qrcodes.js +13 -1
- package/tools/qrcodes/retrieve-qrcodes.js.map +1 -1
- package/tools/qrcodes/retrieve-qrcodes.mjs +11 -2
- package/tools/qrcodes/retrieve-qrcodes.mjs.map +1 -1
- package/tools/qrcodes/update-qrcodes.d.mts.map +1 -1
- package/tools/qrcodes/update-qrcodes.d.ts.map +1 -1
- package/tools/qrcodes/update-qrcodes.js +13 -1
- package/tools/qrcodes/update-qrcodes.js.map +1 -1
- package/tools/qrcodes/update-qrcodes.mjs +11 -2
- package/tools/qrcodes/update-qrcodes.mjs.map +1 -1
- package/tools/qrcodes/upsert-qrcodes.d.mts.map +1 -1
- package/tools/qrcodes/upsert-qrcodes.d.ts.map +1 -1
- package/tools/qrcodes/upsert-qrcodes.js +13 -1
- package/tools/qrcodes/upsert-qrcodes.js.map +1 -1
- package/tools/qrcodes/upsert-qrcodes.mjs +11 -2
- package/tools/qrcodes/upsert-qrcodes.mjs.map +1 -1
- package/tools/tags/create-tags.d.mts.map +1 -1
- package/tools/tags/create-tags.d.ts.map +1 -1
- package/tools/tags/create-tags.js +13 -1
- package/tools/tags/create-tags.js.map +1 -1
- package/tools/tags/create-tags.mjs +12 -3
- package/tools/tags/create-tags.mjs.map +1 -1
- package/tools/tags/delete-tags.d.mts.map +1 -1
- package/tools/tags/delete-tags.d.ts.map +1 -1
- package/tools/tags/delete-tags.js +13 -1
- package/tools/tags/delete-tags.js.map +1 -1
- package/tools/tags/delete-tags.mjs +12 -3
- package/tools/tags/delete-tags.mjs.map +1 -1
- package/tools/tags/list-tags.d.mts.map +1 -1
- package/tools/tags/list-tags.d.ts.map +1 -1
- package/tools/tags/list-tags.js +13 -1
- package/tools/tags/list-tags.js.map +1 -1
- package/tools/tags/list-tags.mjs +12 -3
- package/tools/tags/list-tags.mjs.map +1 -1
- package/tools/tags/update-tags.d.mts.map +1 -1
- package/tools/tags/update-tags.d.ts.map +1 -1
- package/tools/tags/update-tags.js +13 -1
- package/tools/tags/update-tags.js.map +1 -1
- package/tools/tags/update-tags.mjs +12 -3
- package/tools/tags/update-tags.mjs.map +1 -1
- package/tools/track/track-lead-track.d.mts.map +1 -1
- package/tools/track/track-lead-track.d.ts.map +1 -1
- package/tools/track/track-lead-track.js +13 -1
- package/tools/track/track-lead-track.js.map +1 -1
- package/tools/track/track-lead-track.mjs +12 -3
- package/tools/track/track-lead-track.mjs.map +1 -1
- package/tools/track/track-sale-track.d.mts.map +1 -1
- package/tools/track/track-sale-track.d.ts.map +1 -1
- package/tools/track/track-sale-track.js +13 -1
- package/tools/track/track-sale-track.js.map +1 -1
- package/tools/track/track-sale-track.mjs +12 -3
- package/tools/track/track-sale-track.mjs.map +1 -1
- package/tools/types.d.mts +1 -0
- package/tools/types.d.mts.map +1 -1
- package/tools/types.d.ts +1 -0
- package/tools/types.d.ts.map +1 -1
- package/tools/types.js +12 -0
- package/tools/types.js.map +1 -1
- package/tools/types.mjs +11 -0
- package/tools/types.mjs.map +1 -1
package/src/code-tool.ts
CHANGED
|
@@ -132,9 +132,30 @@ export async function codeTool(): Promise<Endpoint> {
|
|
|
132
132
|
content: [returnOutput, logOutput, errOutput].filter((block) => block !== null),
|
|
133
133
|
};
|
|
134
134
|
} else {
|
|
135
|
-
const { message } = (await resp.json()) as WorkerError;
|
|
135
|
+
const { message, logLines, errLines } = (await resp.json()) as WorkerError;
|
|
136
|
+
const messageOutput: ContentBlock | null =
|
|
137
|
+
message == null ? null : (
|
|
138
|
+
{
|
|
139
|
+
type: 'text',
|
|
140
|
+
text: message,
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
const logOutput: ContentBlock | null =
|
|
144
|
+
logLines.length === 0 ?
|
|
145
|
+
null
|
|
146
|
+
: {
|
|
147
|
+
type: 'text',
|
|
148
|
+
text: logLines.join('\n'),
|
|
149
|
+
};
|
|
150
|
+
const errOutput: ContentBlock | null =
|
|
151
|
+
errLines.length === 0 ?
|
|
152
|
+
null
|
|
153
|
+
: {
|
|
154
|
+
type: 'text',
|
|
155
|
+
text: 'Error output:\n' + errLines.join('\n'),
|
|
156
|
+
};
|
|
136
157
|
return {
|
|
137
|
-
content:
|
|
158
|
+
content: [messageOutput, logOutput, errOutput].filter((block) => block !== null),
|
|
138
159
|
isError: true,
|
|
139
160
|
};
|
|
140
161
|
}
|
package/src/docs-search-tool.ts
CHANGED
|
@@ -13,8 +13,7 @@ export const metadata: Metadata = {
|
|
|
13
13
|
|
|
14
14
|
export const tool: Tool = {
|
|
15
15
|
name: 'search_docs',
|
|
16
|
-
description:
|
|
17
|
-
'Search for documentation for how to use the client to interact with the API.\nThe tool will return an array of Markdown-formatted documentation pages.',
|
|
16
|
+
description: 'Search for documentation for how to use the client to interact with the API.',
|
|
18
17
|
inputSchema: {
|
|
19
18
|
type: 'object',
|
|
20
19
|
properties: {
|
|
@@ -25,7 +24,12 @@ export const tool: Tool = {
|
|
|
25
24
|
language: {
|
|
26
25
|
type: 'string',
|
|
27
26
|
description: 'The language for the SDK to search for.',
|
|
28
|
-
enum: ['http', 'python', 'go', 'typescript', 'terraform', 'ruby', 'java', 'kotlin'],
|
|
27
|
+
enum: ['http', 'python', 'go', 'typescript', 'javascript', 'terraform', 'ruby', 'java', 'kotlin'],
|
|
28
|
+
},
|
|
29
|
+
detail: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
description: 'The amount of detail to return.',
|
|
32
|
+
enum: ['default', 'verbose'],
|
|
29
33
|
},
|
|
30
34
|
},
|
|
31
35
|
required: ['query', 'language'],
|
package/src/filtering.ts
CHANGED
|
@@ -12,3 +12,7 @@ export async function maybeFilter(jqFilter: unknown | undefined, response: any):
|
|
|
12
12
|
async function jq(json: any, jqFilter: string) {
|
|
13
13
|
return (await initJq).json(json, jqFilter);
|
|
14
14
|
}
|
|
15
|
+
|
|
16
|
+
export function isJqError(error: any): error is Error {
|
|
17
|
+
return error instanceof Error && 'stderr' in error;
|
|
18
|
+
}
|
package/src/headers.ts
CHANGED
|
@@ -11,7 +11,9 @@ export const parseAuthHeaders = (req: IncomingMessage): Partial<ClientOptions> =
|
|
|
11
11
|
case 'Bearer':
|
|
12
12
|
return { apiKey: req.headers.authorization.slice('Bearer '.length) };
|
|
13
13
|
default:
|
|
14
|
-
throw new Error(
|
|
14
|
+
throw new Error(
|
|
15
|
+
'Unsupported authorization scheme. Expected the "Authorization" header to be a supported scheme (Bearer).',
|
|
16
|
+
);
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
|
package/src/http.ts
CHANGED
|
@@ -46,12 +46,12 @@ const newServer = ({
|
|
|
46
46
|
},
|
|
47
47
|
mcpOptions,
|
|
48
48
|
});
|
|
49
|
-
} catch {
|
|
49
|
+
} catch (error) {
|
|
50
50
|
res.status(401).json({
|
|
51
51
|
jsonrpc: '2.0',
|
|
52
52
|
error: {
|
|
53
53
|
code: -32000,
|
|
54
|
-
message:
|
|
54
|
+
message: `Unauthorized: ${error instanceof Error ? error.message : error}`,
|
|
55
55
|
},
|
|
56
56
|
});
|
|
57
57
|
return null;
|
package/src/server.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
4
4
|
|
|
5
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
6
6
|
import Codeqr from '@codeqr/ts';
|
|
@@ -428,7 +428,14 @@ export const tool: Tool = {
|
|
|
428
428
|
|
|
429
429
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
430
430
|
const body = args as any;
|
|
431
|
-
|
|
431
|
+
try {
|
|
432
|
+
return asTextContentResult(await client.analytics.retrieve(body));
|
|
433
|
+
} catch (error) {
|
|
434
|
+
if (error instanceof Codeqr.APIError) {
|
|
435
|
+
return asErrorResult(error.message);
|
|
436
|
+
}
|
|
437
|
+
throw error;
|
|
438
|
+
}
|
|
432
439
|
};
|
|
433
440
|
|
|
434
441
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Codeqr from '@codeqr/ts';
|
|
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
|
|
|
18
18
|
export const tool: Tool = {
|
|
19
19
|
name: 'create_domains',
|
|
20
20
|
description:
|
|
21
|
-
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nCreate a domain for the authenticated workspace.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/domain',\n $defs: {\n domain: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n description: 'The unique identifier of the domain.'\n },\n archived: {\n type: 'boolean',\n description: 'Whether the domain is archived.'\n },\n createdAt: {\n type: 'string',\n description: 'The date the domain was created.'\n },\n expiredUrl: {\n type: 'string',\n description: 'The URL to redirect to when a link under this domain has expired.'\n },\n placeholder: {\n type: 'string',\n description: 'Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.'\n },\n primary: {\n type: 'boolean',\n description: 'Whether the domain is the primary domain for the project.'\n },\n slug: {\n type: 'string',\n description: 'The domain name.'\n },\n updatedAt: {\n type: 'string',\n description: 'The date the domain was last updated.'\n },\n verified: {\n type: 'boolean',\n description: 'Whether the domain is verified.'\n }\n },\n required: [ 'id',\n 'archived',\n 'createdAt',\n 'expiredUrl',\n 'placeholder',\n 'primary',\n 'slug',\n 'updatedAt',\n 'verified'\n ]\n }\n }\n}\n```",
|
|
21
|
+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nCreate a domain for the authenticated workspace.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/domain',\n $defs: {\n domain: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n description: 'The unique identifier of the domain.'\n },\n archived: {\n type: 'boolean',\n description: 'Whether the domain is archived.'\n },\n createdAt: {\n type: 'string',\n description: 'The date the domain was created.'\n },\n expiredUrl: {\n type: 'string',\n description: 'The URL to redirect to when a link under this domain has expired.'\n },\n placeholder: {\n type: 'string',\n description: 'Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.'\n },\n primary: {\n type: 'boolean',\n description: 'Whether the domain is the primary domain for the project.'\n },\n slug: {\n type: 'string',\n description: 'The domain name.'\n },\n target: {\n type: 'string',\n description: 'The target URL to redirect to when accessing the domain root.'\n },\n type: {\n type: 'string',\n description: 'The behavior type for the domain root redirect.',\n enum: [ 'redirect',\n 'rewrite'\n ]\n },\n updatedAt: {\n type: 'string',\n description: 'The date the domain was last updated.'\n },\n verified: {\n type: 'boolean',\n description: 'Whether the domain is verified.'\n }\n },\n required: [ 'id',\n 'archived',\n 'createdAt',\n 'expiredUrl',\n 'placeholder',\n 'primary',\n 'slug',\n 'target',\n 'type',\n 'updatedAt',\n 'verified'\n ]\n }\n }\n}\n```",
|
|
22
22
|
inputSchema: {
|
|
23
23
|
type: 'object',
|
|
24
24
|
properties: {
|
|
@@ -39,6 +39,15 @@ export const tool: Tool = {
|
|
|
39
39
|
description:
|
|
40
40
|
'Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.',
|
|
41
41
|
},
|
|
42
|
+
target: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
description: 'The target URL to redirect to when accessing the domain root.',
|
|
45
|
+
},
|
|
46
|
+
type: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
description: 'The behavior type for the domain root redirect.',
|
|
49
|
+
enum: ['redirect', 'rewrite'],
|
|
50
|
+
},
|
|
42
51
|
jq_filter: {
|
|
43
52
|
type: 'string',
|
|
44
53
|
title: 'jq Filter',
|
|
@@ -53,7 +62,14 @@ export const tool: Tool = {
|
|
|
53
62
|
|
|
54
63
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
55
64
|
const { jq_filter, ...body } = args as any;
|
|
56
|
-
|
|
65
|
+
try {
|
|
66
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.domains.create(body)));
|
|
67
|
+
} catch (error) {
|
|
68
|
+
if (error instanceof Codeqr.APIError || isJqError(error)) {
|
|
69
|
+
return asErrorResult(error.message);
|
|
70
|
+
}
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
57
73
|
};
|
|
58
74
|
|
|
59
75
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Codeqr from '@codeqr/ts';
|
|
@@ -42,7 +42,14 @@ export const tool: Tool = {
|
|
|
42
42
|
|
|
43
43
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
44
44
|
const { slug, jq_filter, ...body } = args as any;
|
|
45
|
-
|
|
45
|
+
try {
|
|
46
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.domains.delete(slug)));
|
|
47
|
+
} catch (error) {
|
|
48
|
+
if (error instanceof Codeqr.APIError || isJqError(error)) {
|
|
49
|
+
return asErrorResult(error.message);
|
|
50
|
+
}
|
|
51
|
+
throw error;
|
|
52
|
+
}
|
|
46
53
|
};
|
|
47
54
|
|
|
48
55
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Codeqr from '@codeqr/ts';
|
|
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
|
|
|
18
18
|
export const tool: Tool = {
|
|
19
19
|
name: 'list_domains',
|
|
20
20
|
description:
|
|
21
|
-
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nRetrieve a list of domains associated with the authenticated workspace.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/domain_list_response',\n $defs: {\n domain_list_response: {\n type: 'array',\n items: {\n $ref: '#/$defs/domain'\n }\n },\n domain: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n description: 'The unique identifier of the domain.'\n },\n archived: {\n type: 'boolean',\n description: 'Whether the domain is archived.'\n },\n createdAt: {\n type: 'string',\n description: 'The date the domain was created.'\n },\n expiredUrl: {\n type: 'string',\n description: 'The URL to redirect to when a link under this domain has expired.'\n },\n placeholder: {\n type: 'string',\n description: 'Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.'\n },\n primary: {\n type: 'boolean',\n description: 'Whether the domain is the primary domain for the project.'\n },\n slug: {\n type: 'string',\n description: 'The domain name.'\n },\n updatedAt: {\n type: 'string',\n description: 'The date the domain was last updated.'\n },\n verified: {\n type: 'boolean',\n description: 'Whether the domain is verified.'\n }\n },\n required: [ 'id',\n 'archived',\n 'createdAt',\n 'expiredUrl',\n 'placeholder',\n 'primary',\n 'slug',\n 'updatedAt',\n 'verified'\n ]\n }\n }\n}\n```",
|
|
21
|
+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nRetrieve a list of domains associated with the authenticated workspace.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/domain_list_response',\n $defs: {\n domain_list_response: {\n type: 'array',\n items: {\n $ref: '#/$defs/domain'\n }\n },\n domain: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n description: 'The unique identifier of the domain.'\n },\n archived: {\n type: 'boolean',\n description: 'Whether the domain is archived.'\n },\n createdAt: {\n type: 'string',\n description: 'The date the domain was created.'\n },\n expiredUrl: {\n type: 'string',\n description: 'The URL to redirect to when a link under this domain has expired.'\n },\n placeholder: {\n type: 'string',\n description: 'Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.'\n },\n primary: {\n type: 'boolean',\n description: 'Whether the domain is the primary domain for the project.'\n },\n slug: {\n type: 'string',\n description: 'The domain name.'\n },\n target: {\n type: 'string',\n description: 'The target URL to redirect to when accessing the domain root.'\n },\n type: {\n type: 'string',\n description: 'The behavior type for the domain root redirect.',\n enum: [ 'redirect',\n 'rewrite'\n ]\n },\n updatedAt: {\n type: 'string',\n description: 'The date the domain was last updated.'\n },\n verified: {\n type: 'boolean',\n description: 'Whether the domain is verified.'\n }\n },\n required: [ 'id',\n 'archived',\n 'createdAt',\n 'expiredUrl',\n 'placeholder',\n 'primary',\n 'slug',\n 'target',\n 'type',\n 'updatedAt',\n 'verified'\n ]\n }\n }\n}\n```",
|
|
22
22
|
inputSchema: {
|
|
23
23
|
type: 'object',
|
|
24
24
|
properties: {
|
|
@@ -55,7 +55,14 @@ export const tool: Tool = {
|
|
|
55
55
|
|
|
56
56
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
57
57
|
const { jq_filter, ...body } = args as any;
|
|
58
|
-
|
|
58
|
+
try {
|
|
59
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.domains.list(body)));
|
|
60
|
+
} catch (error) {
|
|
61
|
+
if (error instanceof Codeqr.APIError || isJqError(error)) {
|
|
62
|
+
return asErrorResult(error.message);
|
|
63
|
+
}
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
59
66
|
};
|
|
60
67
|
|
|
61
68
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Codeqr from '@codeqr/ts';
|
|
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
|
|
|
18
18
|
export const tool: Tool = {
|
|
19
19
|
name: 'update_domains',
|
|
20
20
|
description:
|
|
21
|
-
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nUpdate a domain for the authenticated workspace.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/domain',\n $defs: {\n domain: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n description: 'The unique identifier of the domain.'\n },\n archived: {\n type: 'boolean',\n description: 'Whether the domain is archived.'\n },\n createdAt: {\n type: 'string',\n description: 'The date the domain was created.'\n },\n expiredUrl: {\n type: 'string',\n description: 'The URL to redirect to when a link under this domain has expired.'\n },\n placeholder: {\n type: 'string',\n description: 'Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.'\n },\n primary: {\n type: 'boolean',\n description: 'Whether the domain is the primary domain for the project.'\n },\n slug: {\n type: 'string',\n description: 'The domain name.'\n },\n updatedAt: {\n type: 'string',\n description: 'The date the domain was last updated.'\n },\n verified: {\n type: 'boolean',\n description: 'Whether the domain is verified.'\n }\n },\n required: [ 'id',\n 'archived',\n 'createdAt',\n 'expiredUrl',\n 'placeholder',\n 'primary',\n 'slug',\n 'updatedAt',\n 'verified'\n ]\n }\n }\n}\n```",
|
|
21
|
+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nUpdate a domain for the authenticated workspace.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/domain',\n $defs: {\n domain: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n description: 'The unique identifier of the domain.'\n },\n archived: {\n type: 'boolean',\n description: 'Whether the domain is archived.'\n },\n createdAt: {\n type: 'string',\n description: 'The date the domain was created.'\n },\n expiredUrl: {\n type: 'string',\n description: 'The URL to redirect to when a link under this domain has expired.'\n },\n placeholder: {\n type: 'string',\n description: 'Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.'\n },\n primary: {\n type: 'boolean',\n description: 'Whether the domain is the primary domain for the project.'\n },\n slug: {\n type: 'string',\n description: 'The domain name.'\n },\n target: {\n type: 'string',\n description: 'The target URL to redirect to when accessing the domain root.'\n },\n type: {\n type: 'string',\n description: 'The behavior type for the domain root redirect.',\n enum: [ 'redirect',\n 'rewrite'\n ]\n },\n updatedAt: {\n type: 'string',\n description: 'The date the domain was last updated.'\n },\n verified: {\n type: 'boolean',\n description: 'Whether the domain is verified.'\n }\n },\n required: [ 'id',\n 'archived',\n 'createdAt',\n 'expiredUrl',\n 'placeholder',\n 'primary',\n 'slug',\n 'target',\n 'type',\n 'updatedAt',\n 'verified'\n ]\n }\n }\n}\n```",
|
|
22
22
|
inputSchema: {
|
|
23
23
|
type: 'object',
|
|
24
24
|
properties: {
|
|
@@ -43,6 +43,15 @@ export const tool: Tool = {
|
|
|
43
43
|
type: 'string',
|
|
44
44
|
description: 'Name of the domain.',
|
|
45
45
|
},
|
|
46
|
+
target: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
description: 'The target URL to redirect to when accessing the domain root.',
|
|
49
|
+
},
|
|
50
|
+
type: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
description: 'The behavior type for the domain root redirect.',
|
|
53
|
+
enum: ['redirect', 'rewrite'],
|
|
54
|
+
},
|
|
46
55
|
jq_filter: {
|
|
47
56
|
type: 'string',
|
|
48
57
|
title: 'jq Filter',
|
|
@@ -57,7 +66,14 @@ export const tool: Tool = {
|
|
|
57
66
|
|
|
58
67
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
59
68
|
const { slug, jq_filter, ...body } = args as any;
|
|
60
|
-
|
|
69
|
+
try {
|
|
70
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.domains.update(slug, body)));
|
|
71
|
+
} catch (error) {
|
|
72
|
+
if (error instanceof Codeqr.APIError || isJqError(error)) {
|
|
73
|
+
return asErrorResult(error.message);
|
|
74
|
+
}
|
|
75
|
+
throw error;
|
|
76
|
+
}
|
|
61
77
|
};
|
|
62
78
|
|
|
63
79
|
export default { metadata, tool, handler };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
4
4
|
|
|
5
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
6
6
|
import Codeqr from '@codeqr/ts';
|
|
@@ -408,7 +408,14 @@ export const tool: Tool = {
|
|
|
408
408
|
|
|
409
409
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
410
410
|
const body = args as any;
|
|
411
|
-
|
|
411
|
+
try {
|
|
412
|
+
return asTextContentResult(await client.events.list(body));
|
|
413
|
+
} catch (error) {
|
|
414
|
+
if (error instanceof Codeqr.APIError) {
|
|
415
|
+
return asErrorResult(error.message);
|
|
416
|
+
}
|
|
417
|
+
throw error;
|
|
418
|
+
}
|
|
412
419
|
};
|
|
413
420
|
|
|
414
421
|
export default { metadata, tool, handler };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
4
4
|
|
|
5
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
6
6
|
import Codeqr from '@codeqr/ts';
|
|
@@ -953,7 +953,14 @@ export const tool: Tool = {
|
|
|
953
953
|
|
|
954
954
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
955
955
|
const body = args as any;
|
|
956
|
-
|
|
956
|
+
try {
|
|
957
|
+
return asTextContentResult(await client.links.bulk.create(body));
|
|
958
|
+
} catch (error) {
|
|
959
|
+
if (error instanceof Codeqr.APIError) {
|
|
960
|
+
return asErrorResult(error.message);
|
|
961
|
+
}
|
|
962
|
+
throw error;
|
|
963
|
+
}
|
|
957
964
|
};
|
|
958
965
|
|
|
959
966
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Codeqr from '@codeqr/ts';
|
|
@@ -46,7 +46,14 @@ export const tool: Tool = {
|
|
|
46
46
|
|
|
47
47
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
48
48
|
const { jq_filter, ...body } = args as any;
|
|
49
|
-
|
|
49
|
+
try {
|
|
50
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.links.bulk.delete(body)));
|
|
51
|
+
} catch (error) {
|
|
52
|
+
if (error instanceof Codeqr.APIError || isJqError(error)) {
|
|
53
|
+
return asErrorResult(error.message);
|
|
54
|
+
}
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
50
57
|
};
|
|
51
58
|
|
|
52
59
|
export default { metadata, tool, handler };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
4
4
|
|
|
5
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
6
6
|
import Codeqr from '@codeqr/ts';
|
|
@@ -944,7 +944,14 @@ export const tool: Tool = {
|
|
|
944
944
|
|
|
945
945
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
946
946
|
const body = args as any;
|
|
947
|
-
|
|
947
|
+
try {
|
|
948
|
+
return asTextContentResult(await client.links.count(body));
|
|
949
|
+
} catch (error) {
|
|
950
|
+
if (error instanceof Codeqr.APIError) {
|
|
951
|
+
return asErrorResult(error.message);
|
|
952
|
+
}
|
|
953
|
+
throw error;
|
|
954
|
+
}
|
|
948
955
|
};
|
|
949
956
|
|
|
950
957
|
export default { metadata, tool, handler };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
4
4
|
|
|
5
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
6
6
|
import Codeqr from '@codeqr/ts';
|
|
@@ -944,7 +944,14 @@ export const tool: Tool = {
|
|
|
944
944
|
|
|
945
945
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
946
946
|
const body = args as any;
|
|
947
|
-
|
|
947
|
+
try {
|
|
948
|
+
return asTextContentResult(await client.links.create(body));
|
|
949
|
+
} catch (error) {
|
|
950
|
+
if (error instanceof Codeqr.APIError) {
|
|
951
|
+
return asErrorResult(error.message);
|
|
952
|
+
}
|
|
953
|
+
throw error;
|
|
954
|
+
}
|
|
948
955
|
};
|
|
949
956
|
|
|
950
957
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Codeqr from '@codeqr/ts';
|
|
@@ -43,7 +43,14 @@ export const tool: Tool = {
|
|
|
43
43
|
|
|
44
44
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
45
45
|
const { linkId, jq_filter, ...body } = args as any;
|
|
46
|
-
|
|
46
|
+
try {
|
|
47
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.links.delete(linkId)));
|
|
48
|
+
} catch (error) {
|
|
49
|
+
if (error instanceof Codeqr.APIError || isJqError(error)) {
|
|
50
|
+
return asErrorResult(error.message);
|
|
51
|
+
}
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
47
54
|
};
|
|
48
55
|
|
|
49
56
|
export default { metadata, tool, handler };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
4
4
|
|
|
5
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
6
6
|
import Codeqr from '@codeqr/ts';
|
|
@@ -967,7 +967,14 @@ export const tool: Tool = {
|
|
|
967
967
|
|
|
968
968
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
969
969
|
const body = args as any;
|
|
970
|
-
|
|
970
|
+
try {
|
|
971
|
+
return asTextContentResult(await client.links.list(body));
|
|
972
|
+
} catch (error) {
|
|
973
|
+
if (error instanceof Codeqr.APIError) {
|
|
974
|
+
return asErrorResult(error.message);
|
|
975
|
+
}
|
|
976
|
+
throw error;
|
|
977
|
+
}
|
|
971
978
|
};
|
|
972
979
|
|
|
973
980
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Codeqr from '@codeqr/ts';
|
|
@@ -62,7 +62,14 @@ export const tool: Tool = {
|
|
|
62
62
|
|
|
63
63
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
64
64
|
const { jq_filter, ...body } = args as any;
|
|
65
|
-
|
|
65
|
+
try {
|
|
66
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.links.retrieveInfo(body)));
|
|
67
|
+
} catch (error) {
|
|
68
|
+
if (error instanceof Codeqr.APIError || isJqError(error)) {
|
|
69
|
+
return asErrorResult(error.message);
|
|
70
|
+
}
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
66
73
|
};
|
|
67
74
|
|
|
68
75
|
export default { metadata, tool, handler };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
4
4
|
|
|
5
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
6
6
|
import Codeqr from '@codeqr/ts';
|
|
@@ -951,7 +951,14 @@ export const tool: Tool = {
|
|
|
951
951
|
|
|
952
952
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
953
953
|
const { linkId, ...body } = args as any;
|
|
954
|
-
|
|
954
|
+
try {
|
|
955
|
+
return asTextContentResult(await client.links.update(linkId, body));
|
|
956
|
+
} catch (error) {
|
|
957
|
+
if (error instanceof Codeqr.APIError) {
|
|
958
|
+
return asErrorResult(error.message);
|
|
959
|
+
}
|
|
960
|
+
throw error;
|
|
961
|
+
}
|
|
955
962
|
};
|
|
956
963
|
|
|
957
964
|
export default { metadata, tool, handler };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
4
4
|
|
|
5
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
6
6
|
import Codeqr from '@codeqr/ts';
|
|
@@ -945,7 +945,14 @@ export const tool: Tool = {
|
|
|
945
945
|
|
|
946
946
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
947
947
|
const body = args as any;
|
|
948
|
-
|
|
948
|
+
try {
|
|
949
|
+
return asTextContentResult(await client.links.upsert(body));
|
|
950
|
+
} catch (error) {
|
|
951
|
+
if (error instanceof Codeqr.APIError) {
|
|
952
|
+
return asErrorResult(error.message);
|
|
953
|
+
}
|
|
954
|
+
throw error;
|
|
955
|
+
}
|
|
949
956
|
};
|
|
950
957
|
|
|
951
958
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Codeqr from '@codeqr/ts';
|
|
@@ -38,7 +38,14 @@ export const tool: Tool = {
|
|
|
38
38
|
|
|
39
39
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
40
40
|
const { jq_filter } = args as any;
|
|
41
|
-
|
|
41
|
+
try {
|
|
42
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.projects.list()));
|
|
43
|
+
} catch (error) {
|
|
44
|
+
if (error instanceof Codeqr.APIError || isJqError(error)) {
|
|
45
|
+
return asErrorResult(error.message);
|
|
46
|
+
}
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
42
49
|
};
|
|
43
50
|
|
|
44
51
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Codeqr from '@codeqr/ts';
|
|
@@ -43,7 +43,14 @@ export const tool: Tool = {
|
|
|
43
43
|
|
|
44
44
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
45
45
|
const { projectSlug, jq_filter, ...body } = args as any;
|
|
46
|
-
|
|
46
|
+
try {
|
|
47
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.projects.retrieve(projectSlug)));
|
|
48
|
+
} catch (error) {
|
|
49
|
+
if (error instanceof Codeqr.APIError || isJqError(error)) {
|
|
50
|
+
return asErrorResult(error.message);
|
|
51
|
+
}
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
47
54
|
};
|
|
48
55
|
|
|
49
56
|
export default { metadata, tool, handler };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
4
4
|
|
|
5
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
6
6
|
import Codeqr from '@codeqr/ts';
|
|
@@ -1064,7 +1064,14 @@ export const tool: Tool = {
|
|
|
1064
1064
|
|
|
1065
1065
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
1066
1066
|
const body = args as any;
|
|
1067
|
-
|
|
1067
|
+
try {
|
|
1068
|
+
return asTextContentResult(await client.qrcodes.bulk.create(body));
|
|
1069
|
+
} catch (error) {
|
|
1070
|
+
if (error instanceof Codeqr.APIError) {
|
|
1071
|
+
return asErrorResult(error.message);
|
|
1072
|
+
}
|
|
1073
|
+
throw error;
|
|
1074
|
+
}
|
|
1068
1075
|
};
|
|
1069
1076
|
|
|
1070
1077
|
export default { metadata, tool, handler };
|