@codeqr/ts-mcp 0.6.0 → 0.7.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 (160) hide show
  1. package/filtering.d.mts +1 -0
  2. package/filtering.d.mts.map +1 -1
  3. package/filtering.d.ts +1 -0
  4. package/filtering.d.ts.map +1 -1
  5. package/filtering.js +4 -0
  6. package/filtering.js.map +1 -1
  7. package/filtering.mjs +3 -0
  8. package/filtering.mjs.map +1 -1
  9. package/headers.d.mts.map +1 -1
  10. package/headers.d.ts.map +1 -1
  11. package/headers.js +1 -1
  12. package/headers.js.map +1 -1
  13. package/headers.mjs +1 -1
  14. package/headers.mjs.map +1 -1
  15. package/http.js +2 -2
  16. package/http.js.map +1 -1
  17. package/http.mjs +2 -2
  18. package/http.mjs.map +1 -1
  19. package/package.json +3 -3
  20. package/server.js +1 -1
  21. package/server.mjs +1 -1
  22. package/src/filtering.ts +4 -0
  23. package/src/headers.ts +3 -1
  24. package/src/http.ts +2 -2
  25. package/src/server.ts +1 -1
  26. package/src/tools/domains/create-domains.ts +20 -4
  27. package/src/tools/domains/delete-domains.ts +10 -3
  28. package/src/tools/domains/list-domains.ts +11 -4
  29. package/src/tools/domains/update-domains.ts +20 -4
  30. package/src/tools/links/bulk/delete-links-bulk.ts +10 -3
  31. package/src/tools/links/delete-links.ts +10 -3
  32. package/src/tools/links/retrieve-info-links.ts +10 -3
  33. package/src/tools/projects/list-projects.ts +10 -3
  34. package/src/tools/projects/retrieve-projects.ts +10 -3
  35. package/src/tools/qrcodes/bulk/delete-qrcodes-bulk.ts +10 -3
  36. package/src/tools/qrcodes/count-qrcodes.ts +10 -3
  37. package/src/tools/qrcodes/delete-qrcodes.ts +10 -3
  38. package/src/tools/tags/create-tags.ts +10 -3
  39. package/src/tools/tags/delete-tags.ts +10 -3
  40. package/src/tools/tags/list-tags.ts +10 -3
  41. package/src/tools/tags/update-tags.ts +10 -3
  42. package/src/tools/track/track-lead-track.ts +10 -3
  43. package/src/tools/track/track-sale-track.ts +10 -3
  44. package/src/tools/types.ts +12 -0
  45. package/tools/domains/create-domains.d.mts.map +1 -1
  46. package/tools/domains/create-domains.d.ts.map +1 -1
  47. package/tools/domains/create-domains.js +19 -2
  48. package/tools/domains/create-domains.js.map +1 -1
  49. package/tools/domains/create-domains.mjs +21 -4
  50. package/tools/domains/create-domains.mjs.map +1 -1
  51. package/tools/domains/delete-domains.d.mts.map +1 -1
  52. package/tools/domains/delete-domains.d.ts.map +1 -1
  53. package/tools/domains/delete-domains.js +9 -1
  54. package/tools/domains/delete-domains.js.map +1 -1
  55. package/tools/domains/delete-domains.mjs +11 -3
  56. package/tools/domains/delete-domains.mjs.map +1 -1
  57. package/tools/domains/list-domains.d.mts.map +1 -1
  58. package/tools/domains/list-domains.d.ts.map +1 -1
  59. package/tools/domains/list-domains.js +10 -2
  60. package/tools/domains/list-domains.js.map +1 -1
  61. package/tools/domains/list-domains.mjs +12 -4
  62. package/tools/domains/list-domains.mjs.map +1 -1
  63. package/tools/domains/update-domains.d.mts.map +1 -1
  64. package/tools/domains/update-domains.d.ts.map +1 -1
  65. package/tools/domains/update-domains.js +19 -2
  66. package/tools/domains/update-domains.js.map +1 -1
  67. package/tools/domains/update-domains.mjs +21 -4
  68. package/tools/domains/update-domains.mjs.map +1 -1
  69. package/tools/links/bulk/delete-links-bulk.d.mts.map +1 -1
  70. package/tools/links/bulk/delete-links-bulk.d.ts.map +1 -1
  71. package/tools/links/bulk/delete-links-bulk.js +9 -1
  72. package/tools/links/bulk/delete-links-bulk.js.map +1 -1
  73. package/tools/links/bulk/delete-links-bulk.mjs +11 -3
  74. package/tools/links/bulk/delete-links-bulk.mjs.map +1 -1
  75. package/tools/links/delete-links.d.mts.map +1 -1
  76. package/tools/links/delete-links.d.ts.map +1 -1
  77. package/tools/links/delete-links.js +9 -1
  78. package/tools/links/delete-links.js.map +1 -1
  79. package/tools/links/delete-links.mjs +11 -3
  80. package/tools/links/delete-links.mjs.map +1 -1
  81. package/tools/links/retrieve-info-links.d.mts.map +1 -1
  82. package/tools/links/retrieve-info-links.d.ts.map +1 -1
  83. package/tools/links/retrieve-info-links.js +9 -1
  84. package/tools/links/retrieve-info-links.js.map +1 -1
  85. package/tools/links/retrieve-info-links.mjs +11 -3
  86. package/tools/links/retrieve-info-links.mjs.map +1 -1
  87. package/tools/projects/list-projects.d.mts.map +1 -1
  88. package/tools/projects/list-projects.d.ts.map +1 -1
  89. package/tools/projects/list-projects.js +9 -1
  90. package/tools/projects/list-projects.js.map +1 -1
  91. package/tools/projects/list-projects.mjs +11 -3
  92. package/tools/projects/list-projects.mjs.map +1 -1
  93. package/tools/projects/retrieve-projects.d.mts.map +1 -1
  94. package/tools/projects/retrieve-projects.d.ts.map +1 -1
  95. package/tools/projects/retrieve-projects.js +9 -1
  96. package/tools/projects/retrieve-projects.js.map +1 -1
  97. package/tools/projects/retrieve-projects.mjs +11 -3
  98. package/tools/projects/retrieve-projects.mjs.map +1 -1
  99. package/tools/qrcodes/bulk/delete-qrcodes-bulk.d.mts.map +1 -1
  100. package/tools/qrcodes/bulk/delete-qrcodes-bulk.d.ts.map +1 -1
  101. package/tools/qrcodes/bulk/delete-qrcodes-bulk.js +9 -1
  102. package/tools/qrcodes/bulk/delete-qrcodes-bulk.js.map +1 -1
  103. package/tools/qrcodes/bulk/delete-qrcodes-bulk.mjs +11 -3
  104. package/tools/qrcodes/bulk/delete-qrcodes-bulk.mjs.map +1 -1
  105. package/tools/qrcodes/count-qrcodes.d.mts.map +1 -1
  106. package/tools/qrcodes/count-qrcodes.d.ts.map +1 -1
  107. package/tools/qrcodes/count-qrcodes.js +9 -1
  108. package/tools/qrcodes/count-qrcodes.js.map +1 -1
  109. package/tools/qrcodes/count-qrcodes.mjs +11 -3
  110. package/tools/qrcodes/count-qrcodes.mjs.map +1 -1
  111. package/tools/qrcodes/delete-qrcodes.d.mts.map +1 -1
  112. package/tools/qrcodes/delete-qrcodes.d.ts.map +1 -1
  113. package/tools/qrcodes/delete-qrcodes.js +9 -1
  114. package/tools/qrcodes/delete-qrcodes.js.map +1 -1
  115. package/tools/qrcodes/delete-qrcodes.mjs +11 -3
  116. package/tools/qrcodes/delete-qrcodes.mjs.map +1 -1
  117. package/tools/tags/create-tags.d.mts.map +1 -1
  118. package/tools/tags/create-tags.d.ts.map +1 -1
  119. package/tools/tags/create-tags.js +9 -1
  120. package/tools/tags/create-tags.js.map +1 -1
  121. package/tools/tags/create-tags.mjs +11 -3
  122. package/tools/tags/create-tags.mjs.map +1 -1
  123. package/tools/tags/delete-tags.d.mts.map +1 -1
  124. package/tools/tags/delete-tags.d.ts.map +1 -1
  125. package/tools/tags/delete-tags.js +9 -1
  126. package/tools/tags/delete-tags.js.map +1 -1
  127. package/tools/tags/delete-tags.mjs +11 -3
  128. package/tools/tags/delete-tags.mjs.map +1 -1
  129. package/tools/tags/list-tags.d.mts.map +1 -1
  130. package/tools/tags/list-tags.d.ts.map +1 -1
  131. package/tools/tags/list-tags.js +9 -1
  132. package/tools/tags/list-tags.js.map +1 -1
  133. package/tools/tags/list-tags.mjs +11 -3
  134. package/tools/tags/list-tags.mjs.map +1 -1
  135. package/tools/tags/update-tags.d.mts.map +1 -1
  136. package/tools/tags/update-tags.d.ts.map +1 -1
  137. package/tools/tags/update-tags.js +9 -1
  138. package/tools/tags/update-tags.js.map +1 -1
  139. package/tools/tags/update-tags.mjs +11 -3
  140. package/tools/tags/update-tags.mjs.map +1 -1
  141. package/tools/track/track-lead-track.d.mts.map +1 -1
  142. package/tools/track/track-lead-track.d.ts.map +1 -1
  143. package/tools/track/track-lead-track.js +9 -1
  144. package/tools/track/track-lead-track.js.map +1 -1
  145. package/tools/track/track-lead-track.mjs +11 -3
  146. package/tools/track/track-lead-track.mjs.map +1 -1
  147. package/tools/track/track-sale-track.d.mts.map +1 -1
  148. package/tools/track/track-sale-track.d.ts.map +1 -1
  149. package/tools/track/track-sale-track.js +9 -1
  150. package/tools/track/track-sale-track.js.map +1 -1
  151. package/tools/track/track-sale-track.mjs +11 -3
  152. package/tools/track/track-sale-track.mjs.map +1 -1
  153. package/tools/types.d.mts +1 -0
  154. package/tools/types.d.mts.map +1 -1
  155. package/tools/types.d.ts +1 -0
  156. package/tools/types.d.ts.map +1 -1
  157. package/tools/types.js +12 -0
  158. package/tools/types.js.map +1 -1
  159. package/tools/types.mjs +11 -0
  160. package/tools/types.mjs.map +1 -1
@@ -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';
@@ -207,7 +207,14 @@ export const tool: Tool = {
207
207
 
208
208
  export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
209
209
  const { jq_filter, ...body } = args as any;
210
- return asTextContentResult(await maybeFilter(jq_filter, await client.qrcodes.count(body)));
210
+ try {
211
+ return asTextContentResult(await maybeFilter(jq_filter, await client.qrcodes.count(body)));
212
+ } catch (error) {
213
+ if (isJqError(error)) {
214
+ return asErrorResult(error.message);
215
+ }
216
+ throw error;
217
+ }
211
218
  };
212
219
 
213
220
  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 { qrcodeId, jq_filter, ...body } = args as any;
46
- return asTextContentResult(await maybeFilter(jq_filter, await client.qrcodes.delete(qrcodeId)));
46
+ try {
47
+ return asTextContentResult(await maybeFilter(jq_filter, await client.qrcodes.delete(qrcodeId)));
48
+ } catch (error) {
49
+ if (isJqError(error)) {
50
+ return asErrorResult(error.message);
51
+ }
52
+ throw error;
53
+ }
47
54
  };
48
55
 
49
56
  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.tags.create(body)));
49
+ try {
50
+ return asTextContentResult(await maybeFilter(jq_filter, await client.tags.create(body)));
51
+ } catch (error) {
52
+ if (isJqError(error)) {
53
+ return asErrorResult(error.message);
54
+ }
55
+ throw error;
56
+ }
50
57
  };
51
58
 
52
59
  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 { id, jq_filter, ...body } = args as any;
45
- return asTextContentResult(await maybeFilter(jq_filter, await client.tags.delete(id)));
45
+ try {
46
+ return asTextContentResult(await maybeFilter(jq_filter, await client.tags.delete(id)));
47
+ } catch (error) {
48
+ if (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';
@@ -74,7 +74,14 @@ export const tool: Tool = {
74
74
 
75
75
  export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
76
76
  const { jq_filter, ...body } = args as any;
77
- return asTextContentResult(await maybeFilter(jq_filter, await client.tags.list(body)));
77
+ try {
78
+ return asTextContentResult(await maybeFilter(jq_filter, await client.tags.list(body)));
79
+ } catch (error) {
80
+ if (isJqError(error)) {
81
+ return asErrorResult(error.message);
82
+ }
83
+ throw error;
84
+ }
78
85
  };
79
86
 
80
87
  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';
@@ -50,7 +50,14 @@ export const tool: Tool = {
50
50
 
51
51
  export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
52
52
  const { id, jq_filter, ...body } = args as any;
53
- return asTextContentResult(await maybeFilter(jq_filter, await client.tags.update(id, body)));
53
+ try {
54
+ return asTextContentResult(await maybeFilter(jq_filter, await client.tags.update(id, body)));
55
+ } catch (error) {
56
+ if (isJqError(error)) {
57
+ return asErrorResult(error.message);
58
+ }
59
+ throw error;
60
+ }
54
61
  };
55
62
 
56
63
  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';
@@ -80,7 +80,14 @@ export const tool: Tool = {
80
80
 
81
81
  export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
82
82
  const { jq_filter, ...body } = args as any;
83
- return asTextContentResult(await maybeFilter(jq_filter, await client.track.trackLead(body)));
83
+ try {
84
+ return asTextContentResult(await maybeFilter(jq_filter, await client.track.trackLead(body)));
85
+ } catch (error) {
86
+ if (isJqError(error)) {
87
+ return asErrorResult(error.message);
88
+ }
89
+ throw error;
90
+ }
84
91
  };
85
92
 
86
93
  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';
@@ -95,7 +95,14 @@ export const tool: Tool = {
95
95
 
96
96
  export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
97
97
  const { jq_filter, ...body } = args as any;
98
- return asTextContentResult(await maybeFilter(jq_filter, await client.track.trackSale(body)));
98
+ try {
99
+ return asTextContentResult(await maybeFilter(jq_filter, await client.track.trackSale(body)));
100
+ } catch (error) {
101
+ if (isJqError(error)) {
102
+ return asErrorResult(error.message);
103
+ }
104
+ throw error;
105
+ }
99
106
  };
100
107
 
101
108
  export default { metadata, tool, handler };
@@ -87,6 +87,18 @@ export async function asBinaryContentResult(response: Response): Promise<ToolCal
87
87
  }
88
88
  }
89
89
 
90
+ export function asErrorResult(message: string): ToolCallResult {
91
+ return {
92
+ content: [
93
+ {
94
+ type: 'text',
95
+ text: message,
96
+ },
97
+ ],
98
+ isError: true,
99
+ };
100
+ }
101
+
90
102
  export type Metadata = {
91
103
  resource: string;
92
104
  operation: 'read' | 'write';
@@ -1 +1 @@
1
- {"version":3,"file":"create-domains.d.mts","sourceRoot":"","sources":["../../src/tools/domains/create-domains.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAuB,MAAM,4BAA4B;OAEnE,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,MAAM,MAAM,YAAY;AAE/B,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAkClB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAGtF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHoC,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAKvF,wBAA2C"}
1
+ {"version":3,"file":"create-domains.d.mts","sourceRoot":"","sources":["../../src/tools/domains/create-domains.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,MAAM,MAAM,YAAY;AAE/B,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IA2ClB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUtF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYvF,wBAA2C"}
@@ -1 +1 @@
1
- {"version":3,"file":"create-domains.d.ts","sourceRoot":"","sources":["../../src/tools/domains/create-domains.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAuB,MAAM,4BAA4B;OAEnE,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,MAAM,MAAM,YAAY;AAE/B,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAkClB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAGtF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHoC,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAKvF,wBAA2C"}
1
+ {"version":3,"file":"create-domains.d.ts","sourceRoot":"","sources":["../../src/tools/domains/create-domains.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,MAAM,MAAM,YAAY;AAE/B,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IA2ClB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUtF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYvF,wBAA2C"}
@@ -14,7 +14,7 @@ exports.metadata = {
14
14
  };
15
15
  exports.tool = {
16
16
  name: 'create_domains',
17
- description: "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```",
17
+ description: "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```",
18
18
  inputSchema: {
19
19
  type: 'object',
20
20
  properties: {
@@ -34,6 +34,15 @@ exports.tool = {
34
34
  type: 'string',
35
35
  description: 'Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.',
36
36
  },
37
+ target: {
38
+ type: 'string',
39
+ description: 'The target URL to redirect to when accessing the domain root.',
40
+ },
41
+ type: {
42
+ type: 'string',
43
+ description: 'The behavior type for the domain root redirect.',
44
+ enum: ['redirect', 'rewrite'],
45
+ },
37
46
  jq_filter: {
38
47
  type: 'string',
39
48
  title: 'jq Filter',
@@ -46,7 +55,15 @@ exports.tool = {
46
55
  };
47
56
  const handler = async (client, args) => {
48
57
  const { jq_filter, ...body } = args;
49
- return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.domains.create(body)));
58
+ try {
59
+ return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.domains.create(body)));
60
+ }
61
+ catch (error) {
62
+ if ((0, filtering_1.isJqError)(error)) {
63
+ return (0, types_1.asErrorResult)(error.message);
64
+ }
65
+ throw error;
66
+ }
50
67
  };
51
68
  exports.handler = handler;
52
69
  exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
@@ -1 +1 @@
1
- {"version":3,"file":"create-domains.js","sourceRoot":"","sources":["../../src/tools/domains/create-domains.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAuD;AACvD,sDAA2E;AAK9D,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,SAAS;IACnB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,cAAc;CAC5B,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACT,6vDAA6vD;IAC/vD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qBAAqB;aACnC;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,sFAAsF;aACpG;YACD,UAAU,EAAE;gBACV,IAAI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EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { maybeFilter } from '@codeqr/ts-mcp/filtering';
3
- import { asTextContentResult } from '@codeqr/ts-mcp/tools/types';
2
+ import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
3
+ import { asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
4
4
  export const metadata = {
5
5
  resource: 'domains',
6
6
  operation: 'write',
@@ -11,7 +11,7 @@ export const metadata = {
11
11
  };
12
12
  export const tool = {
13
13
  name: 'create_domains',
14
- description: "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```",
14
+ description: "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```",
15
15
  inputSchema: {
16
16
  type: 'object',
17
17
  properties: {
@@ -31,6 +31,15 @@ export const tool = {
31
31
  type: 'string',
32
32
  description: 'Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.',
33
33
  },
34
+ target: {
35
+ type: 'string',
36
+ description: 'The target URL to redirect to when accessing the domain root.',
37
+ },
38
+ type: {
39
+ type: 'string',
40
+ description: 'The behavior type for the domain root redirect.',
41
+ enum: ['redirect', 'rewrite'],
42
+ },
34
43
  jq_filter: {
35
44
  type: 'string',
36
45
  title: 'jq Filter',
@@ -43,7 +52,15 @@ export const tool = {
43
52
  };
44
53
  export const handler = async (client, args) => {
45
54
  const { jq_filter, ...body } = args;
46
- return asTextContentResult(await maybeFilter(jq_filter, await client.domains.create(body)));
55
+ try {
56
+ return asTextContentResult(await maybeFilter(jq_filter, await client.domains.create(body)));
57
+ }
58
+ catch (error) {
59
+ if (isJqError(error)) {
60
+ return asErrorResult(error.message);
61
+ }
62
+ throw error;
63
+ }
47
64
  };
48
65
  export default { metadata, tool, handler };
49
66
  //# sourceMappingURL=create-domains.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-domains.mjs","sourceRoot":"","sources":["../../src/tools/domains/create-domains.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE,MAAM,0BAA0B;OAC/C,EAAY,mBAAmB,EAAE,MAAM,4BAA4B;AAK1E,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,SAAS;IACnB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,cAAc;CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAS;IACxB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACT,6vDAA6vD;IAC/vD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qBAAqB;aACnC;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,sFAAsF;aACpG;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+EAA+E;aAC7F;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,oHAAoH;aACvH;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,MAAM,CAAC;KACnB;IACD,WAAW,EAAE,EAAE;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,E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C,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAGtF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHoC,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAKvF,wBAA2C"}
1
+ {"version":3,"file":"delete-domains.d.mts","sourceRoot":"","sources":["../../src/tools/domains/delete-domains.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,MAAM,MAAM,YAAY;AAE/B,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAuBlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUtF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYvF,wBAA2C"}
@@ -1 +1 @@
1
- {"version":3,"file":"delete-domains.d.ts","sourceRoot":"","sources":["../../src/tools/domains/delete-domains.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAuB,MAAM,4BAA4B;OAEnE,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,MAAM,MAAM,YAAY;AAE/B,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAuBlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAGtF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHoC,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAKvF,wBAA2C"}
1
+ {"version":3,"file":"delete-domains.d.ts","sourceRoot":"","sources":["../../src/tools/domains/delete-domains.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,MAAM,MAAM,YAAY;AAE/B,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAuBlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUtF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYvF,wBAA2C"}
@@ -36,7 +36,15 @@ exports.tool = {
36
36
  };
37
37
  const handler = async (client, args) => {
38
38
  const { slug, jq_filter, ...body } = args;
39
- return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.domains.delete(slug)));
39
+ try {
40
+ return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.domains.delete(slug)));
41
+ }
42
+ catch (error) {
43
+ if ((0, filtering_1.isJqError)(error)) {
44
+ return (0, types_1.asErrorResult)(error.message);
45
+ }
46
+ throw error;
47
+ }
40
48
  };
41
49
  exports.handler = handler;
42
50
  exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
@@ -1 +1 @@
1
- {"version":3,"file":"delete-domains.js","sourceRoot":"","sources":["../../src/tools/domains/delete-domains.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAuD;AACvD,sDAA2E;AAK9D,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,SAAS;IACnB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,QAAQ;IACpB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AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACT,6mBAA6mB;IAC/mB,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kBAAkB;aAChC;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,MAAM,CAAC;KACnB;IACD,WAAW,EAAE;QACX,cAAc,EAAE,IAAI;KACrB;CACF,CAAC;AAEK,MAAM,OAAO,GAAG,KAAK,EAAE,MAAc,EAAE,IAAyC,EAAE,EAAE;IACzF,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IACjD,IAAI,CAAC;QACH,OAAO,IAAA,2BAAmB,EAAC,MAAM,IAAA,uBAAW,EAAC,SAAS,EAAE,MAAM,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9F,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,IAAA,qBAAS,EAAC,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO,IAAA,qBAAa,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAVW,QAAA,OAAO,WAUlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { maybeFilter } from '@codeqr/ts-mcp/filtering';
3
- import { asTextContentResult } from '@codeqr/ts-mcp/tools/types';
2
+ import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
3
+ import { asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
4
4
  export const metadata = {
5
5
  resource: 'domains',
6
6
  operation: 'write',
@@ -33,7 +33,15 @@ export const tool = {
33
33
  };
34
34
  export const handler = async (client, args) => {
35
35
  const { slug, jq_filter, ...body } = args;
36
- return asTextContentResult(await maybeFilter(jq_filter, await client.domains.delete(slug)));
36
+ try {
37
+ return asTextContentResult(await maybeFilter(jq_filter, await client.domains.delete(slug)));
38
+ }
39
+ catch (error) {
40
+ if (isJqError(error)) {
41
+ return asErrorResult(error.message);
42
+ }
43
+ throw error;
44
+ }
37
45
  };
38
46
  export default { metadata, tool, handler };
39
47
  //# sourceMappingURL=delete-domains.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"delete-domains.mjs","sourceRoot":"","sources":["../../src/tools/domains/delete-domains.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE,MAAM,0BAA0B;OAC/C,EAAY,mBAAmB,EAAE,MAAM,4BAA4B;AAK1E,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,SAAS;IACnB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,QAAQ;IACpB,QAAQ,EAAE,iBAAiB;IAC3B,WAAW,EAAE,cAAc;CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAS;IACxB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACT,6mBAA6mB;IAC/mB,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kBAAkB;aAChC;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,MAAM,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QACX,cAAc,EAAE,IAAI;KACrB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,MAAc,EAAE,IAAyC,EAAE,EAAE;IACzF,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IACjD,IAAI,CAAC;QACH,OAAO,mBAAmB,CAAC,MAAM,WAAW,CAAC,SAAS,EAAE,MAAM,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9F,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"list-domains.d.mts","sourceRoot":"","sources":["../../src/tools/domains/list-domains.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAuB,MAAM,4BAA4B;OAEnE,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,MAAM,MAAM,YAAY;AAE/B,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAoClB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAGtF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHoC,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAKvF,wBAA2C"}
1
+ {"version":3,"file":"list-domains.d.mts","sourceRoot":"","sources":["../../src/tools/domains/list-domains.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,MAAM,MAAM,YAAY;AAE/B,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAoClB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUtF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYvF,wBAA2C"}
@@ -1 +1 @@
1
- {"version":3,"file":"list-domains.d.ts","sourceRoot":"","sources":["../../src/tools/domains/list-domains.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAuB,MAAM,4BAA4B;OAEnE,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,MAAM,MAAM,YAAY;AAE/B,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAoClB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAGtF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHoC,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAKvF,wBAA2C"}
1
+ {"version":3,"file":"list-domains.d.ts","sourceRoot":"","sources":["../../src/tools/domains/list-domains.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,MAAM,MAAM,YAAY;AAE/B,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAoClB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUtF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYvF,wBAA2C"}
@@ -14,7 +14,7 @@ exports.metadata = {
14
14
  };
15
15
  exports.tool = {
16
16
  name: 'list_domains',
17
- description: "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```",
17
+ description: "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```",
18
18
  inputSchema: {
19
19
  type: 'object',
20
20
  properties: {
@@ -48,7 +48,15 @@ exports.tool = {
48
48
  };
49
49
  const handler = async (client, args) => {
50
50
  const { jq_filter, ...body } = args;
51
- return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.domains.list(body)));
51
+ try {
52
+ return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.domains.list(body)));
53
+ }
54
+ catch (error) {
55
+ if ((0, filtering_1.isJqError)(error)) {
56
+ return (0, types_1.asErrorResult)(error.message);
57
+ }
58
+ throw error;
59
+ }
52
60
  };
53
61
  exports.handler = handler;
54
62
  exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
@@ -1 +1 @@
1
- {"version":3,"file":"list-domains.js","sourceRoot":"","sources":["../../src/tools/domains/list-domains.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAuD;AACvD,sDAA2E;AAK9D,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,SAAS;IACnB,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,aAAa;CAC3B,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,cAAc;IACpB,WAAW,EACT,s5DAAs5D;IACx5D,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,SAAS;gBACf,WAAW,EACT,2FAA2F;aAC9F;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iCAAiC;aAC/C;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+BAA+B;aAC7C;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,2CAA2C;aACzD;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,EAAE;KACb;IACD,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;KACnB;CACF,CAAC;AAEK,MAAM,OAAO,GAAG,KAAK,EAAE,MAAc,EAAE,IAAyC,EAAE,EAAE;IACzF,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IAC3C,OAAO,IAAA,2BAAmB,EAAC,MAAM,IAAA,uBAAW,EAAC,SAAS,EAAE,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAA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AC;IAC3C,IAAI,CAAC;QACH,OAAO,IAAA,2BAAmB,EAAC,MAAM,IAAA,uBAAW,EAAC,SAAS,EAAE,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5F,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,IAAA,qBAAS,EAAC,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO,IAAA,qBAAa,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAVW,QAAA,OAAO,WAUlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { maybeFilter } from '@codeqr/ts-mcp/filtering';
3
- import { asTextContentResult } from '@codeqr/ts-mcp/tools/types';
2
+ import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
3
+ import { asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
4
4
  export const metadata = {
5
5
  resource: 'domains',
6
6
  operation: 'read',
@@ -11,7 +11,7 @@ export const metadata = {
11
11
  };
12
12
  export const tool = {
13
13
  name: 'list_domains',
14
- description: "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```",
14
+ description: "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```",
15
15
  inputSchema: {
16
16
  type: 'object',
17
17
  properties: {
@@ -45,7 +45,15 @@ export const tool = {
45
45
  };
46
46
  export const handler = async (client, args) => {
47
47
  const { jq_filter, ...body } = args;
48
- return asTextContentResult(await maybeFilter(jq_filter, await client.domains.list(body)));
48
+ try {
49
+ return asTextContentResult(await maybeFilter(jq_filter, await client.domains.list(body)));
50
+ }
51
+ catch (error) {
52
+ if (isJqError(error)) {
53
+ return asErrorResult(error.message);
54
+ }
55
+ throw error;
56
+ }
49
57
  };
50
58
  export default { metadata, tool, handler };
51
59
  //# sourceMappingURL=list-domains.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-domains.mjs","sourceRoot":"","sources":["../../src/tools/domains/list-domains.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE,MAAM,0BAA0B;OAC/C,EAAY,mBAAmB,EAAE,MAAM,4BAA4B;AAK1E,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,SAAS;IACnB,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,aAAa;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAS;IACxB,IAAI,EAAE,cAAc;IACpB,WAAW,EACT,s5DAAs5D;IACx5D,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,SAAS;gBACf,WAAW,EACT,2FAA2F;aAC9F;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iCAAiC;aAC/C;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+BAA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,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAsClB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAGtF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHoC,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAKvF,wBAA2C"}
1
+ {"version":3,"file":"update-domains.d.mts","sourceRoot":"","sources":["../../src/tools/domains/update-domains.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,MAAM,MAAM,YAAY;AAE/B,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IA+ClB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUtF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYvF,wBAA2C"}
@@ -1 +1 @@
1
- {"version":3,"file":"update-domains.d.ts","sourceRoot":"","sources":["../../src/tools/domains/update-domains.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAuB,MAAM,4BAA4B;OAEnE,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,MAAM,MAAM,YAAY;AAE/B,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAsClB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAGtF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHoC,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAKvF,wBAA2C"}
1
+ {"version":3,"file":"update-domains.d.ts","sourceRoot":"","sources":["../../src/tools/domains/update-domains.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,MAAM,MAAM,YAAY;AAE/B,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IA+ClB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUtF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYvF,wBAA2C"}