@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.
Files changed (284) hide show
  1. package/code-tool-types.d.mts +2 -0
  2. package/code-tool-types.d.mts.map +1 -1
  3. package/code-tool-types.d.ts +2 -0
  4. package/code-tool-types.d.ts.map +1 -1
  5. package/code-tool-worker.d.mts.map +1 -1
  6. package/code-tool-worker.d.ts.map +1 -1
  7. package/code-tool-worker.js +6 -0
  8. package/code-tool-worker.js.map +1 -1
  9. package/code-tool-worker.mjs +6 -0
  10. package/code-tool-worker.mjs.map +1 -1
  11. package/code-tool.d.mts.map +1 -1
  12. package/code-tool.d.ts.map +1 -1
  13. package/code-tool.js +18 -2
  14. package/code-tool.js.map +1 -1
  15. package/code-tool.mjs +18 -2
  16. package/code-tool.mjs.map +1 -1
  17. package/docs-search-tool.d.mts.map +1 -1
  18. package/docs-search-tool.d.ts.map +1 -1
  19. package/docs-search-tool.js +7 -2
  20. package/docs-search-tool.js.map +1 -1
  21. package/docs-search-tool.mjs +7 -2
  22. package/docs-search-tool.mjs.map +1 -1
  23. package/filtering.d.mts +1 -0
  24. package/filtering.d.mts.map +1 -1
  25. package/filtering.d.ts +1 -0
  26. package/filtering.d.ts.map +1 -1
  27. package/filtering.js +4 -0
  28. package/filtering.js.map +1 -1
  29. package/filtering.mjs +3 -0
  30. package/filtering.mjs.map +1 -1
  31. package/headers.d.mts.map +1 -1
  32. package/headers.d.ts.map +1 -1
  33. package/headers.js +1 -1
  34. package/headers.js.map +1 -1
  35. package/headers.mjs +1 -1
  36. package/headers.mjs.map +1 -1
  37. package/http.js +2 -2
  38. package/http.js.map +1 -1
  39. package/http.mjs +2 -2
  40. package/http.mjs.map +1 -1
  41. package/package.json +3 -3
  42. package/server.js +1 -1
  43. package/server.mjs +1 -1
  44. package/src/code-tool-types.ts +5 -1
  45. package/src/code-tool-worker.ts +6 -0
  46. package/src/code-tool.ts +23 -2
  47. package/src/docs-search-tool.ts +7 -3
  48. package/src/filtering.ts +4 -0
  49. package/src/headers.ts +3 -1
  50. package/src/http.ts +2 -2
  51. package/src/server.ts +1 -1
  52. package/src/tools/analytics/retrieve-analytics.ts +9 -2
  53. package/src/tools/domains/create-domains.ts +20 -4
  54. package/src/tools/domains/delete-domains.ts +10 -3
  55. package/src/tools/domains/list-domains.ts +11 -4
  56. package/src/tools/domains/update-domains.ts +20 -4
  57. package/src/tools/events/list-events.ts +9 -2
  58. package/src/tools/links/bulk/create-links-bulk.ts +9 -2
  59. package/src/tools/links/bulk/delete-links-bulk.ts +10 -3
  60. package/src/tools/links/count-links.ts +9 -2
  61. package/src/tools/links/create-links.ts +9 -2
  62. package/src/tools/links/delete-links.ts +10 -3
  63. package/src/tools/links/list-links.ts +9 -2
  64. package/src/tools/links/retrieve-info-links.ts +10 -3
  65. package/src/tools/links/update-links.ts +9 -2
  66. package/src/tools/links/upsert-links.ts +9 -2
  67. package/src/tools/projects/list-projects.ts +10 -3
  68. package/src/tools/projects/retrieve-projects.ts +10 -3
  69. package/src/tools/qrcodes/bulk/create-qrcodes-bulk.ts +9 -2
  70. package/src/tools/qrcodes/bulk/delete-qrcodes-bulk.ts +10 -3
  71. package/src/tools/qrcodes/count-qrcodes.ts +10 -3
  72. package/src/tools/qrcodes/create-qrcodes.ts +9 -2
  73. package/src/tools/qrcodes/delete-qrcodes.ts +10 -3
  74. package/src/tools/qrcodes/list-qrcodes.ts +9 -2
  75. package/src/tools/qrcodes/retrieve-qrcodes.ts +9 -2
  76. package/src/tools/qrcodes/update-qrcodes.ts +9 -2
  77. package/src/tools/qrcodes/upsert-qrcodes.ts +9 -2
  78. package/src/tools/tags/create-tags.ts +10 -3
  79. package/src/tools/tags/delete-tags.ts +10 -3
  80. package/src/tools/tags/list-tags.ts +10 -3
  81. package/src/tools/tags/update-tags.ts +10 -3
  82. package/src/tools/track/track-lead-track.ts +10 -3
  83. package/src/tools/track/track-sale-track.ts +10 -3
  84. package/src/tools/types.ts +12 -0
  85. package/tools/analytics/retrieve-analytics.d.mts.map +1 -1
  86. package/tools/analytics/retrieve-analytics.d.ts.map +1 -1
  87. package/tools/analytics/retrieve-analytics.js +13 -1
  88. package/tools/analytics/retrieve-analytics.js.map +1 -1
  89. package/tools/analytics/retrieve-analytics.mjs +11 -2
  90. package/tools/analytics/retrieve-analytics.mjs.map +1 -1
  91. package/tools/domains/create-domains.d.mts.map +1 -1
  92. package/tools/domains/create-domains.d.ts.map +1 -1
  93. package/tools/domains/create-domains.js +23 -2
  94. package/tools/domains/create-domains.js.map +1 -1
  95. package/tools/domains/create-domains.mjs +22 -4
  96. package/tools/domains/create-domains.mjs.map +1 -1
  97. package/tools/domains/delete-domains.d.mts.map +1 -1
  98. package/tools/domains/delete-domains.d.ts.map +1 -1
  99. package/tools/domains/delete-domains.js +13 -1
  100. package/tools/domains/delete-domains.js.map +1 -1
  101. package/tools/domains/delete-domains.mjs +12 -3
  102. package/tools/domains/delete-domains.mjs.map +1 -1
  103. package/tools/domains/list-domains.d.mts.map +1 -1
  104. package/tools/domains/list-domains.d.ts.map +1 -1
  105. package/tools/domains/list-domains.js +14 -2
  106. package/tools/domains/list-domains.js.map +1 -1
  107. package/tools/domains/list-domains.mjs +13 -4
  108. package/tools/domains/list-domains.mjs.map +1 -1
  109. package/tools/domains/update-domains.d.mts.map +1 -1
  110. package/tools/domains/update-domains.d.ts.map +1 -1
  111. package/tools/domains/update-domains.js +23 -2
  112. package/tools/domains/update-domains.js.map +1 -1
  113. package/tools/domains/update-domains.mjs +22 -4
  114. package/tools/domains/update-domains.mjs.map +1 -1
  115. package/tools/events/list-events.d.mts.map +1 -1
  116. package/tools/events/list-events.d.ts.map +1 -1
  117. package/tools/events/list-events.js +13 -1
  118. package/tools/events/list-events.js.map +1 -1
  119. package/tools/events/list-events.mjs +11 -2
  120. package/tools/events/list-events.mjs.map +1 -1
  121. package/tools/links/bulk/create-links-bulk.d.mts.map +1 -1
  122. package/tools/links/bulk/create-links-bulk.d.ts.map +1 -1
  123. package/tools/links/bulk/create-links-bulk.js +13 -1
  124. package/tools/links/bulk/create-links-bulk.js.map +1 -1
  125. package/tools/links/bulk/create-links-bulk.mjs +11 -2
  126. package/tools/links/bulk/create-links-bulk.mjs.map +1 -1
  127. package/tools/links/bulk/delete-links-bulk.d.mts.map +1 -1
  128. package/tools/links/bulk/delete-links-bulk.d.ts.map +1 -1
  129. package/tools/links/bulk/delete-links-bulk.js +13 -1
  130. package/tools/links/bulk/delete-links-bulk.js.map +1 -1
  131. package/tools/links/bulk/delete-links-bulk.mjs +12 -3
  132. package/tools/links/bulk/delete-links-bulk.mjs.map +1 -1
  133. package/tools/links/count-links.d.mts.map +1 -1
  134. package/tools/links/count-links.d.ts.map +1 -1
  135. package/tools/links/count-links.js +13 -1
  136. package/tools/links/count-links.js.map +1 -1
  137. package/tools/links/count-links.mjs +11 -2
  138. package/tools/links/count-links.mjs.map +1 -1
  139. package/tools/links/create-links.d.mts.map +1 -1
  140. package/tools/links/create-links.d.ts.map +1 -1
  141. package/tools/links/create-links.js +13 -1
  142. package/tools/links/create-links.js.map +1 -1
  143. package/tools/links/create-links.mjs +11 -2
  144. package/tools/links/create-links.mjs.map +1 -1
  145. package/tools/links/delete-links.d.mts.map +1 -1
  146. package/tools/links/delete-links.d.ts.map +1 -1
  147. package/tools/links/delete-links.js +13 -1
  148. package/tools/links/delete-links.js.map +1 -1
  149. package/tools/links/delete-links.mjs +12 -3
  150. package/tools/links/delete-links.mjs.map +1 -1
  151. package/tools/links/list-links.d.mts.map +1 -1
  152. package/tools/links/list-links.d.ts.map +1 -1
  153. package/tools/links/list-links.js +13 -1
  154. package/tools/links/list-links.js.map +1 -1
  155. package/tools/links/list-links.mjs +11 -2
  156. package/tools/links/list-links.mjs.map +1 -1
  157. package/tools/links/retrieve-info-links.d.mts.map +1 -1
  158. package/tools/links/retrieve-info-links.d.ts.map +1 -1
  159. package/tools/links/retrieve-info-links.js +13 -1
  160. package/tools/links/retrieve-info-links.js.map +1 -1
  161. package/tools/links/retrieve-info-links.mjs +12 -3
  162. package/tools/links/retrieve-info-links.mjs.map +1 -1
  163. package/tools/links/update-links.d.mts.map +1 -1
  164. package/tools/links/update-links.d.ts.map +1 -1
  165. package/tools/links/update-links.js +13 -1
  166. package/tools/links/update-links.js.map +1 -1
  167. package/tools/links/update-links.mjs +11 -2
  168. package/tools/links/update-links.mjs.map +1 -1
  169. package/tools/links/upsert-links.d.mts.map +1 -1
  170. package/tools/links/upsert-links.d.ts.map +1 -1
  171. package/tools/links/upsert-links.js +13 -1
  172. package/tools/links/upsert-links.js.map +1 -1
  173. package/tools/links/upsert-links.mjs +11 -2
  174. package/tools/links/upsert-links.mjs.map +1 -1
  175. package/tools/projects/list-projects.d.mts.map +1 -1
  176. package/tools/projects/list-projects.d.ts.map +1 -1
  177. package/tools/projects/list-projects.js +13 -1
  178. package/tools/projects/list-projects.js.map +1 -1
  179. package/tools/projects/list-projects.mjs +12 -3
  180. package/tools/projects/list-projects.mjs.map +1 -1
  181. package/tools/projects/retrieve-projects.d.mts.map +1 -1
  182. package/tools/projects/retrieve-projects.d.ts.map +1 -1
  183. package/tools/projects/retrieve-projects.js +13 -1
  184. package/tools/projects/retrieve-projects.js.map +1 -1
  185. package/tools/projects/retrieve-projects.mjs +12 -3
  186. package/tools/projects/retrieve-projects.mjs.map +1 -1
  187. package/tools/qrcodes/bulk/create-qrcodes-bulk.d.mts.map +1 -1
  188. package/tools/qrcodes/bulk/create-qrcodes-bulk.d.ts.map +1 -1
  189. package/tools/qrcodes/bulk/create-qrcodes-bulk.js +13 -1
  190. package/tools/qrcodes/bulk/create-qrcodes-bulk.js.map +1 -1
  191. package/tools/qrcodes/bulk/create-qrcodes-bulk.mjs +11 -2
  192. package/tools/qrcodes/bulk/create-qrcodes-bulk.mjs.map +1 -1
  193. package/tools/qrcodes/bulk/delete-qrcodes-bulk.d.mts.map +1 -1
  194. package/tools/qrcodes/bulk/delete-qrcodes-bulk.d.ts.map +1 -1
  195. package/tools/qrcodes/bulk/delete-qrcodes-bulk.js +13 -1
  196. package/tools/qrcodes/bulk/delete-qrcodes-bulk.js.map +1 -1
  197. package/tools/qrcodes/bulk/delete-qrcodes-bulk.mjs +12 -3
  198. package/tools/qrcodes/bulk/delete-qrcodes-bulk.mjs.map +1 -1
  199. package/tools/qrcodes/count-qrcodes.d.mts.map +1 -1
  200. package/tools/qrcodes/count-qrcodes.d.ts.map +1 -1
  201. package/tools/qrcodes/count-qrcodes.js +13 -1
  202. package/tools/qrcodes/count-qrcodes.js.map +1 -1
  203. package/tools/qrcodes/count-qrcodes.mjs +12 -3
  204. package/tools/qrcodes/count-qrcodes.mjs.map +1 -1
  205. package/tools/qrcodes/create-qrcodes.d.mts.map +1 -1
  206. package/tools/qrcodes/create-qrcodes.d.ts.map +1 -1
  207. package/tools/qrcodes/create-qrcodes.js +13 -1
  208. package/tools/qrcodes/create-qrcodes.js.map +1 -1
  209. package/tools/qrcodes/create-qrcodes.mjs +11 -2
  210. package/tools/qrcodes/create-qrcodes.mjs.map +1 -1
  211. package/tools/qrcodes/delete-qrcodes.d.mts.map +1 -1
  212. package/tools/qrcodes/delete-qrcodes.d.ts.map +1 -1
  213. package/tools/qrcodes/delete-qrcodes.js +13 -1
  214. package/tools/qrcodes/delete-qrcodes.js.map +1 -1
  215. package/tools/qrcodes/delete-qrcodes.mjs +12 -3
  216. package/tools/qrcodes/delete-qrcodes.mjs.map +1 -1
  217. package/tools/qrcodes/list-qrcodes.d.mts.map +1 -1
  218. package/tools/qrcodes/list-qrcodes.d.ts.map +1 -1
  219. package/tools/qrcodes/list-qrcodes.js +13 -1
  220. package/tools/qrcodes/list-qrcodes.js.map +1 -1
  221. package/tools/qrcodes/list-qrcodes.mjs +11 -2
  222. package/tools/qrcodes/list-qrcodes.mjs.map +1 -1
  223. package/tools/qrcodes/retrieve-qrcodes.d.mts.map +1 -1
  224. package/tools/qrcodes/retrieve-qrcodes.d.ts.map +1 -1
  225. package/tools/qrcodes/retrieve-qrcodes.js +13 -1
  226. package/tools/qrcodes/retrieve-qrcodes.js.map +1 -1
  227. package/tools/qrcodes/retrieve-qrcodes.mjs +11 -2
  228. package/tools/qrcodes/retrieve-qrcodes.mjs.map +1 -1
  229. package/tools/qrcodes/update-qrcodes.d.mts.map +1 -1
  230. package/tools/qrcodes/update-qrcodes.d.ts.map +1 -1
  231. package/tools/qrcodes/update-qrcodes.js +13 -1
  232. package/tools/qrcodes/update-qrcodes.js.map +1 -1
  233. package/tools/qrcodes/update-qrcodes.mjs +11 -2
  234. package/tools/qrcodes/update-qrcodes.mjs.map +1 -1
  235. package/tools/qrcodes/upsert-qrcodes.d.mts.map +1 -1
  236. package/tools/qrcodes/upsert-qrcodes.d.ts.map +1 -1
  237. package/tools/qrcodes/upsert-qrcodes.js +13 -1
  238. package/tools/qrcodes/upsert-qrcodes.js.map +1 -1
  239. package/tools/qrcodes/upsert-qrcodes.mjs +11 -2
  240. package/tools/qrcodes/upsert-qrcodes.mjs.map +1 -1
  241. package/tools/tags/create-tags.d.mts.map +1 -1
  242. package/tools/tags/create-tags.d.ts.map +1 -1
  243. package/tools/tags/create-tags.js +13 -1
  244. package/tools/tags/create-tags.js.map +1 -1
  245. package/tools/tags/create-tags.mjs +12 -3
  246. package/tools/tags/create-tags.mjs.map +1 -1
  247. package/tools/tags/delete-tags.d.mts.map +1 -1
  248. package/tools/tags/delete-tags.d.ts.map +1 -1
  249. package/tools/tags/delete-tags.js +13 -1
  250. package/tools/tags/delete-tags.js.map +1 -1
  251. package/tools/tags/delete-tags.mjs +12 -3
  252. package/tools/tags/delete-tags.mjs.map +1 -1
  253. package/tools/tags/list-tags.d.mts.map +1 -1
  254. package/tools/tags/list-tags.d.ts.map +1 -1
  255. package/tools/tags/list-tags.js +13 -1
  256. package/tools/tags/list-tags.js.map +1 -1
  257. package/tools/tags/list-tags.mjs +12 -3
  258. package/tools/tags/list-tags.mjs.map +1 -1
  259. package/tools/tags/update-tags.d.mts.map +1 -1
  260. package/tools/tags/update-tags.d.ts.map +1 -1
  261. package/tools/tags/update-tags.js +13 -1
  262. package/tools/tags/update-tags.js.map +1 -1
  263. package/tools/tags/update-tags.mjs +12 -3
  264. package/tools/tags/update-tags.mjs.map +1 -1
  265. package/tools/track/track-lead-track.d.mts.map +1 -1
  266. package/tools/track/track-lead-track.d.ts.map +1 -1
  267. package/tools/track/track-lead-track.js +13 -1
  268. package/tools/track/track-lead-track.js.map +1 -1
  269. package/tools/track/track-lead-track.mjs +12 -3
  270. package/tools/track/track-lead-track.mjs.map +1 -1
  271. package/tools/track/track-sale-track.d.mts.map +1 -1
  272. package/tools/track/track-sale-track.d.ts.map +1 -1
  273. package/tools/track/track-sale-track.js +13 -1
  274. package/tools/track/track-sale-track.js.map +1 -1
  275. package/tools/track/track-sale-track.mjs +12 -3
  276. package/tools/track/track-sale-track.mjs.map +1 -1
  277. package/tools/types.d.mts +1 -0
  278. package/tools/types.d.mts.map +1 -1
  279. package/tools/types.d.ts +1 -0
  280. package/tools/types.d.ts.map +1 -1
  281. package/tools/types.js +12 -0
  282. package/tools/types.js.map +1 -1
  283. package/tools/types.mjs +11 -0
  284. 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: message == null ? [] : [{ type: 'text', text: message }],
158
+ content: [messageOutput, logOutput, errOutput].filter((block) => block !== null),
138
159
  isError: true,
139
160
  };
140
161
  }
@@ -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(`Unsupported authorization scheme`);
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: 'Unauthorized',
54
+ message: `Unauthorized: ${error instanceof Error ? error.message : error}`,
55
55
  },
56
56
  });
57
57
  return null;
package/src/server.ts CHANGED
@@ -34,7 +34,7 @@ export const newMcpServer = () =>
34
34
  new McpServer(
35
35
  {
36
36
  name: 'codeqr_ts_api',
37
- version: '0.6.0',
37
+ version: '0.8.0',
38
38
  },
39
39
  { capabilities: { tools: {}, logging: {} } },
40
40
  );
@@ -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
- return asTextContentResult(await client.analytics.retrieve(body));
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
- return asTextContentResult(await maybeFilter(jq_filter, await client.domains.create(body)));
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
- return asTextContentResult(await maybeFilter(jq_filter, await client.domains.delete(slug)));
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
- return asTextContentResult(await maybeFilter(jq_filter, await client.domains.list(body)));
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
- return asTextContentResult(await maybeFilter(jq_filter, await client.domains.update(slug, body)));
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
- return asTextContentResult(await client.events.list(body));
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
- return asTextContentResult(await client.links.bulk.create(body));
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
- return asTextContentResult(await maybeFilter(jq_filter, await client.links.bulk.delete(body)));
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
- return asTextContentResult(await client.links.count(body));
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
- return asTextContentResult(await client.links.create(body));
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
- return asTextContentResult(await maybeFilter(jq_filter, await client.links.delete(linkId)));
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
- return asTextContentResult(await client.links.list(body));
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
- return asTextContentResult(await maybeFilter(jq_filter, await client.links.retrieveInfo(body)));
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
- return asTextContentResult(await client.links.update(linkId, body));
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
- return asTextContentResult(await client.links.upsert(body));
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
- return asTextContentResult(await maybeFilter(jq_filter, await client.projects.list()));
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
- return asTextContentResult(await maybeFilter(jq_filter, await client.projects.retrieve(projectSlug)));
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
- return asTextContentResult(await client.qrcodes.bulk.create(body));
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 };