nuxt-graphql-middleware 5.2.3 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/CqRv5mwS.js +2 -0
- package/dist/client/_nuxt/{gyQx9VSj.js → D95LLO0l.js} +1 -1
- package/dist/client/_nuxt/{DyBqp5hr.js → DZ-uq6Vd.js} +1 -1
- package/dist/client/_nuxt/DrXVleME.js +4 -0
- package/dist/client/_nuxt/{BPB7Y782.js → Dx-h1-qv.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/f3f3372e-493e-4c8e-9dbd-18d4c5406f44.json +1 -0
- package/dist/client/index.html +1 -1
- package/dist/module.d.mts +1 -1
- package/dist/module.json +3 -3
- package/dist/module.mjs +1526 -70
- package/dist/runtime/components/CodeFrame.d.vue.ts +8 -0
- package/dist/runtime/components/CodeFrame.vue.d.ts +2 -1
- package/dist/runtime/components/DevModeOverlay.d.vue.ts +4 -0
- package/dist/runtime/components/DevModeOverlay.vue.d.ts +2 -1
- package/dist/runtime/components/ErrorExtensions.d.vue.ts +6 -0
- package/dist/runtime/components/ErrorExtensions.vue.d.ts +2 -1
- package/dist/runtime/components/ErrorGroup.d.vue.ts +10 -0
- package/dist/runtime/components/ErrorGroup.vue.d.ts +2 -1
- package/dist/runtime/helpers/composables.d.ts +1 -40
- package/dist/runtime/helpers/composables.js +3 -12
- package/dist/runtime/helpers/shared-types.d.ts +40 -0
- package/dist/runtime/helpers/shared-types.js +12 -0
- package/dist/runtime/server/api/doRequest.d.ts +2 -0
- package/dist/runtime/server/api/doRequest.js +18 -0
- package/dist/runtime/server/helpers/index.js +1 -1
- package/dist/runtime/server/mcp/index.d.ts +2 -0
- package/dist/runtime/server/mcp/index.js +63 -0
- package/dist/runtime/server/mcp/resources/docs.d.ts +2 -0
- package/dist/runtime/server/mcp/resources/docs.js +36 -0
- package/dist/runtime/server/mcp/tools/fragments-get/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/fragments-get/index.js +35 -0
- package/dist/runtime/server/mcp/tools/fragments-get/types.d.ts +20 -0
- package/dist/runtime/server/mcp/tools/fragments-get/types.js +13 -0
- package/dist/runtime/server/mcp/tools/fragments-get-source/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/fragments-get-source/index.js +34 -0
- package/dist/runtime/server/mcp/tools/fragments-get-source/types.d.ts +10 -0
- package/dist/runtime/server/mcp/tools/fragments-get-source/types.js +9 -0
- package/dist/runtime/server/mcp/tools/fragments-list/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/fragments-list/index.js +36 -0
- package/dist/runtime/server/mcp/tools/fragments-list/types.d.ts +20 -0
- package/dist/runtime/server/mcp/tools/fragments-list/types.js +14 -0
- package/dist/runtime/server/mcp/tools/fragments-list-for-type/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/fragments-list-for-type/index.js +39 -0
- package/dist/runtime/server/mcp/tools/fragments-list-for-type/types.d.ts +31 -0
- package/dist/runtime/server/mcp/tools/fragments-list-for-type/types.js +23 -0
- package/dist/runtime/server/mcp/tools/graphql-execute/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/graphql-execute/index.js +59 -0
- package/dist/runtime/server/mcp/tools/module-get-config/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/module-get-config/index.js +23 -0
- package/dist/runtime/server/mcp/tools/module-get-config/types.d.ts +39 -0
- package/dist/runtime/server/mcp/tools/module-get-config/types.js +26 -0
- package/dist/runtime/server/mcp/tools/nitro-graphql-server-utils-example/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/nitro-graphql-server-utils-example/index.js +36 -0
- package/dist/runtime/server/mcp/tools/nitro-graphql-server-utils-example/types.d.ts +49 -0
- package/dist/runtime/server/mcp/tools/nitro-graphql-server-utils-example/types.js +24 -0
- package/dist/runtime/server/mcp/tools/operations-execute/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/operations-execute/index.js +63 -0
- package/dist/runtime/server/mcp/tools/operations-get/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/operations-get/index.js +40 -0
- package/dist/runtime/server/mcp/tools/operations-get/types.d.ts +32 -0
- package/dist/runtime/server/mcp/tools/operations-get/types.js +18 -0
- package/dist/runtime/server/mcp/tools/operations-get-field-usage/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/operations-get-field-usage/index.js +39 -0
- package/dist/runtime/server/mcp/tools/operations-get-field-usage/types.d.ts +38 -0
- package/dist/runtime/server/mcp/tools/operations-get-field-usage/types.js +19 -0
- package/dist/runtime/server/mcp/tools/operations-get-source/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/operations-get-source/index.js +39 -0
- package/dist/runtime/server/mcp/tools/operations-get-source/types.d.ts +10 -0
- package/dist/runtime/server/mcp/tools/operations-get-source/types.js +9 -0
- package/dist/runtime/server/mcp/tools/operations-list/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/operations-list/index.js +46 -0
- package/dist/runtime/server/mcp/tools/operations-list/types.d.ts +53 -0
- package/dist/runtime/server/mcp/tools/operations-list/types.js +33 -0
- package/dist/runtime/server/mcp/tools/schema-get-interface-implementors/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/schema-get-interface-implementors/index.js +37 -0
- package/dist/runtime/server/mcp/tools/schema-get-interface-implementors/types.d.ts +24 -0
- package/dist/runtime/server/mcp/tools/schema-get-interface-implementors/types.js +16 -0
- package/dist/runtime/server/mcp/tools/schema-get-type/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/schema-get-type/index.js +31 -0
- package/dist/runtime/server/mcp/tools/schema-get-type/types.d.ts +112 -0
- package/dist/runtime/server/mcp/tools/schema-get-type/types.js +45 -0
- package/dist/runtime/server/mcp/tools/schema-get-type-definition/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/schema-get-type-definition/index.js +33 -0
- package/dist/runtime/server/mcp/tools/schema-get-type-definition/types.d.ts +10 -0
- package/dist/runtime/server/mcp/tools/schema-get-type-definition/types.js +9 -0
- package/dist/runtime/server/mcp/tools/schema-get-type-usage/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/schema-get-type-usage/index.js +35 -0
- package/dist/runtime/server/mcp/tools/schema-get-type-usage/types.d.ts +39 -0
- package/dist/runtime/server/mcp/tools/schema-get-type-usage/types.js +17 -0
- package/dist/runtime/server/mcp/tools/schema-get-union-members/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/schema-get-union-members/index.js +35 -0
- package/dist/runtime/server/mcp/tools/schema-get-union-members/types.d.ts +24 -0
- package/dist/runtime/server/mcp/tools/schema-get-union-members/types.js +16 -0
- package/dist/runtime/server/mcp/tools/schema-list-types/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/schema-list-types/index.js +37 -0
- package/dist/runtime/server/mcp/tools/schema-list-types/types.d.ts +53 -0
- package/dist/runtime/server/mcp/tools/schema-list-types/types.js +21 -0
- package/dist/runtime/server/mcp/tools/schema-validate-document/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/schema-validate-document/index.js +31 -0
- package/dist/runtime/server/mcp/tools/schema-validate-document/types.d.ts +26 -0
- package/dist/runtime/server/mcp/tools/schema-validate-document/types.js +21 -0
- package/dist/runtime/server/mcp/tools/vue-graphql-composable-example/index.d.ts +1 -0
- package/dist/runtime/server/mcp/tools/vue-graphql-composable-example/index.js +36 -0
- package/dist/runtime/server/mcp/tools/vue-graphql-composable-example/types.d.ts +49 -0
- package/dist/runtime/server/mcp/tools/vue-graphql-composable-example/types.js +24 -0
- package/dist/runtime/server/mcp/utils/index.d.ts +48 -0
- package/dist/runtime/server/mcp/utils/index.js +35 -0
- package/dist/runtime/server/utils/useGraphqlMutation.d.ts +1 -1
- package/dist/runtime/server/utils/useGraphqlMutation.js +1 -1
- package/dist/runtime/server/utils/useGraphqlQuery.d.ts +1 -1
- package/dist/runtime/server/utils/useGraphqlQuery.js +1 -1
- package/dist/shared/{nuxt-graphql-middleware.ct2xvPoD.d.mts → nuxt-graphql-middleware.COufMnWs.d.mts} +119 -2
- package/dist/utils.d.mts +1 -1
- package/docs/composables/useAsyncGraphqlQuery.md +313 -0
- package/docs/composables/useGraphqlMutation.md +29 -0
- package/docs/composables/useGraphqlQuery.md +73 -0
- package/docs/composables/useGraphqlState.md +58 -0
- package/docs/composables/useGraphqlUploadMutation.md +57 -0
- package/docs/configuration/client-options.md +121 -0
- package/docs/configuration/module-hooks.md +112 -0
- package/docs/configuration/module-utils.md +53 -0
- package/docs/configuration/module.md +415 -0
- package/docs/configuration/runtime-config.md +23 -0
- package/docs/configuration/server-options.md +230 -0
- package/package.json +101 -44
- package/dist/client/_nuxt/Bkyil6hz.js +0 -2
- package/dist/client/_nuxt/C9p-Va5c.js +0 -29
- package/dist/client/_nuxt/builds/meta/77b9a31d-6d5c-4e28-9320-cbd287a46883.json +0 -1
- package/dist/runtime/server/tsconfig.json +0 -3
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineMcpTool } from "#imports";
|
|
3
|
+
import { fetchFromMcpHandler, structuredResult } from "./../../utils/index.js";
|
|
4
|
+
import {
|
|
5
|
+
listOperationsOutputSchema,
|
|
6
|
+
OperationTypeFilterSchema
|
|
7
|
+
} from "./types.js";
|
|
8
|
+
export const listOperationsTool = defineMcpTool({
|
|
9
|
+
name: "operations-list",
|
|
10
|
+
title: "List Operations",
|
|
11
|
+
description: "List all GraphQL operations (queries and mutations) available in the project. Returns operation names, types, file paths, and variable requirements.",
|
|
12
|
+
annotations: {
|
|
13
|
+
readOnlyHint: true,
|
|
14
|
+
destructiveHint: false,
|
|
15
|
+
idempotentHint: true,
|
|
16
|
+
openWorldHint: false
|
|
17
|
+
},
|
|
18
|
+
inputSchema: {
|
|
19
|
+
nameFilter: z.string().optional().describe(
|
|
20
|
+
'Optional filter to match operation names. Can be a plain string for substring matching or a regex pattern (e.g., "^get" to match names starting with "get")'
|
|
21
|
+
),
|
|
22
|
+
type: OperationTypeFilterSchema.optional().describe(
|
|
23
|
+
'Optional filter by operation type: "query" or "mutation"'
|
|
24
|
+
)
|
|
25
|
+
},
|
|
26
|
+
outputSchema: listOperationsOutputSchema,
|
|
27
|
+
handler: async ({ nameFilter, type }) => {
|
|
28
|
+
const response = await fetchFromMcpHandler(
|
|
29
|
+
"operations-list",
|
|
30
|
+
{ nameFilter, type }
|
|
31
|
+
);
|
|
32
|
+
const summary = response.operations.map((op) => ({
|
|
33
|
+
name: op.name,
|
|
34
|
+
type: op.type,
|
|
35
|
+
filePath: op.relativeFilePath,
|
|
36
|
+
hasVariables: op.hasVariables,
|
|
37
|
+
needsVariables: op.needsVariables,
|
|
38
|
+
variablesTypeName: op.variablesTypeName,
|
|
39
|
+
responseTypeName: op.responseTypeName
|
|
40
|
+
}));
|
|
41
|
+
return structuredResult({
|
|
42
|
+
count: response.operations.length,
|
|
43
|
+
operations: summary
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const OperationTypeFilterSchema: z.ZodEnum<{
|
|
3
|
+
query: "query";
|
|
4
|
+
mutation: "mutation";
|
|
5
|
+
}>;
|
|
6
|
+
export type OperationTypeFilter = z.infer<typeof OperationTypeFilterSchema>;
|
|
7
|
+
export declare const CollectorOperationSchema: z.ZodObject<{
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
type: z.ZodEnum<{
|
|
10
|
+
query: "query";
|
|
11
|
+
mutation: "mutation";
|
|
12
|
+
}>;
|
|
13
|
+
filePath: z.ZodString;
|
|
14
|
+
relativeFilePath: z.ZodString;
|
|
15
|
+
hasVariables: z.ZodBoolean;
|
|
16
|
+
needsVariables: z.ZodBoolean;
|
|
17
|
+
variablesTypeName: z.ZodString;
|
|
18
|
+
responseTypeName: z.ZodString;
|
|
19
|
+
source: z.ZodString;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export declare const ListOperationsResponseSchema: z.ZodObject<{
|
|
22
|
+
operations: z.ZodArray<z.ZodObject<{
|
|
23
|
+
name: z.ZodString;
|
|
24
|
+
type: z.ZodEnum<{
|
|
25
|
+
query: "query";
|
|
26
|
+
mutation: "mutation";
|
|
27
|
+
}>;
|
|
28
|
+
filePath: z.ZodString;
|
|
29
|
+
relativeFilePath: z.ZodString;
|
|
30
|
+
hasVariables: z.ZodBoolean;
|
|
31
|
+
needsVariables: z.ZodBoolean;
|
|
32
|
+
variablesTypeName: z.ZodString;
|
|
33
|
+
responseTypeName: z.ZodString;
|
|
34
|
+
source: z.ZodString;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export declare const listOperationsOutputSchema: {
|
|
38
|
+
count: z.ZodNumber;
|
|
39
|
+
operations: z.ZodArray<z.ZodObject<{
|
|
40
|
+
name: z.ZodString;
|
|
41
|
+
type: z.ZodEnum<{
|
|
42
|
+
query: "query";
|
|
43
|
+
mutation: "mutation";
|
|
44
|
+
}>;
|
|
45
|
+
filePath: z.ZodString;
|
|
46
|
+
hasVariables: z.ZodBoolean;
|
|
47
|
+
needsVariables: z.ZodBoolean;
|
|
48
|
+
variablesTypeName: z.ZodString;
|
|
49
|
+
responseTypeName: z.ZodString;
|
|
50
|
+
}, z.core.$strip>>;
|
|
51
|
+
};
|
|
52
|
+
export type CollectorOperation = z.infer<typeof CollectorOperationSchema>;
|
|
53
|
+
export type ListOperationsResponse = z.infer<typeof ListOperationsResponseSchema>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const OperationTypeFilterSchema = z.enum(["query", "mutation"]);
|
|
3
|
+
export const CollectorOperationSchema = z.object({
|
|
4
|
+
name: z.string().describe("The GraphQL operation name"),
|
|
5
|
+
type: z.enum(["query", "mutation"]).describe("The type of operation (query or mutation)"),
|
|
6
|
+
filePath: z.string().describe("Absolute path to the file containing the operation"),
|
|
7
|
+
relativeFilePath: z.string().describe("Path to the file relative to the project root"),
|
|
8
|
+
hasVariables: z.boolean().describe("Whether the operation has any variables"),
|
|
9
|
+
needsVariables: z.boolean().describe(
|
|
10
|
+
"Whether the operation requires variables (has non-null variables)"
|
|
11
|
+
),
|
|
12
|
+
variablesTypeName: z.string().describe("TypeScript type name for the operation variables"),
|
|
13
|
+
responseTypeName: z.string().describe("TypeScript type name for the operation response"),
|
|
14
|
+
source: z.string().describe("The GraphQL source code of the operation")
|
|
15
|
+
});
|
|
16
|
+
export const ListOperationsResponseSchema = z.object({
|
|
17
|
+
operations: z.array(CollectorOperationSchema)
|
|
18
|
+
});
|
|
19
|
+
const OperationMcpSchema = z.object({
|
|
20
|
+
name: z.string().describe("The GraphQL operation name"),
|
|
21
|
+
type: z.enum(["query", "mutation"]).describe("The type of operation (query or mutation)"),
|
|
22
|
+
filePath: z.string().describe("Path to the file relative to the project root"),
|
|
23
|
+
hasVariables: z.boolean().describe("Whether the operation has any variables"),
|
|
24
|
+
needsVariables: z.boolean().describe(
|
|
25
|
+
"Whether the operation requires variables (has non-null variables)"
|
|
26
|
+
),
|
|
27
|
+
variablesTypeName: z.string().describe("TypeScript type name for the operation variables"),
|
|
28
|
+
responseTypeName: z.string().describe("TypeScript type name for the operation response")
|
|
29
|
+
});
|
|
30
|
+
export const listOperationsOutputSchema = {
|
|
31
|
+
count: z.number().describe("Total number of operations"),
|
|
32
|
+
operations: z.array(OperationMcpSchema).describe("List of all operations")
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getTypesImplementingInterfaceTool: any;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineMcpTool } from "#imports";
|
|
3
|
+
import { fetchFromMcpHandler, structuredResult } from "./../../utils/index.js";
|
|
4
|
+
import {
|
|
5
|
+
getTypesImplementingInterfaceOutputSchema
|
|
6
|
+
} from "./types.js";
|
|
7
|
+
export const getTypesImplementingInterfaceTool = defineMcpTool({
|
|
8
|
+
name: "schema-get-interface-implementors",
|
|
9
|
+
title: "Get Interface Implementors",
|
|
10
|
+
description: "Get all object types that implement a given GraphQL interface. Returns the implementing type names and descriptions.",
|
|
11
|
+
annotations: {
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
destructiveHint: false,
|
|
14
|
+
idempotentHint: true,
|
|
15
|
+
openWorldHint: false
|
|
16
|
+
},
|
|
17
|
+
inputSchema: {
|
|
18
|
+
interfaceName: z.string().describe(
|
|
19
|
+
'The name of the GraphQL interface (e.g., "Node", "Connection")'
|
|
20
|
+
)
|
|
21
|
+
},
|
|
22
|
+
outputSchema: getTypesImplementingInterfaceOutputSchema,
|
|
23
|
+
handler: async ({ interfaceName }) => {
|
|
24
|
+
const response = await fetchFromMcpHandler(
|
|
25
|
+
"schema-get-interface-implementors",
|
|
26
|
+
{ name: interfaceName }
|
|
27
|
+
);
|
|
28
|
+
if (response.error) {
|
|
29
|
+
return structuredResult({ error: response.error });
|
|
30
|
+
}
|
|
31
|
+
return structuredResult({
|
|
32
|
+
interfaceName: response.interfaceName,
|
|
33
|
+
count: response.types.length,
|
|
34
|
+
types: response.types
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ImplementingTypeSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
description: z.ZodNullable<z.ZodString>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export declare const GetTypesImplementingInterfaceResponseSchema: z.ZodObject<{
|
|
7
|
+
interfaceName: z.ZodString;
|
|
8
|
+
types: z.ZodArray<z.ZodObject<{
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
description: z.ZodNullable<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
error: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const getTypesImplementingInterfaceOutputSchema: {
|
|
15
|
+
interfaceName: z.ZodOptional<z.ZodString>;
|
|
16
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
types: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
18
|
+
name: z.ZodString;
|
|
19
|
+
description: z.ZodNullable<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>>>;
|
|
21
|
+
error: z.ZodOptional<z.ZodString>;
|
|
22
|
+
};
|
|
23
|
+
export type ImplementingType = z.infer<typeof ImplementingTypeSchema>;
|
|
24
|
+
export type GetTypesImplementingInterfaceResponse = z.infer<typeof GetTypesImplementingInterfaceResponseSchema>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const ImplementingTypeSchema = z.object({
|
|
3
|
+
name: z.string().describe("Type name"),
|
|
4
|
+
description: z.string().nullable().describe("Type description")
|
|
5
|
+
});
|
|
6
|
+
export const GetTypesImplementingInterfaceResponseSchema = z.object({
|
|
7
|
+
interfaceName: z.string().describe("The interface name"),
|
|
8
|
+
types: z.array(ImplementingTypeSchema),
|
|
9
|
+
error: z.string().optional().describe("Error message if interface not found")
|
|
10
|
+
});
|
|
11
|
+
export const getTypesImplementingInterfaceOutputSchema = {
|
|
12
|
+
interfaceName: z.string().optional().describe("The interface name"),
|
|
13
|
+
count: z.number().optional().describe("Number of implementing types"),
|
|
14
|
+
types: z.array(ImplementingTypeSchema).optional().describe("Types that implement the interface"),
|
|
15
|
+
error: z.string().optional().describe("Error message if interface not found")
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getSchemaTypeTool: any;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineMcpTool } from "#imports";
|
|
3
|
+
import { fetchFromMcpHandler, structuredResult } from "./../../utils/index.js";
|
|
4
|
+
import { getSchemaTypeOutputSchema } from "./types.js";
|
|
5
|
+
export const getSchemaTypeTool = defineMcpTool({
|
|
6
|
+
name: "schema-get-type",
|
|
7
|
+
title: "Get Schema Type",
|
|
8
|
+
description: "Get detailed information about a GraphQL type from the schema. Returns the type kind (OBJECT, INPUT_OBJECT, ENUM, UNION, INTERFACE, SCALAR), description, fields with their types, enum values, possible types for unions, and implemented interfaces.",
|
|
9
|
+
annotations: {
|
|
10
|
+
readOnlyHint: true,
|
|
11
|
+
destructiveHint: false,
|
|
12
|
+
idempotentHint: true,
|
|
13
|
+
openWorldHint: false
|
|
14
|
+
},
|
|
15
|
+
inputSchema: {
|
|
16
|
+
typeName: z.string().describe(
|
|
17
|
+
'The name of the GraphQL type to inspect (e.g., "User", "CreateUserInput", "UserRole")'
|
|
18
|
+
)
|
|
19
|
+
},
|
|
20
|
+
outputSchema: getSchemaTypeOutputSchema,
|
|
21
|
+
handler: async ({ typeName }) => {
|
|
22
|
+
const response = await fetchFromMcpHandler(
|
|
23
|
+
"schema-get-type",
|
|
24
|
+
{ name: typeName }
|
|
25
|
+
);
|
|
26
|
+
if (response.error) {
|
|
27
|
+
return structuredResult({ error: response.error });
|
|
28
|
+
}
|
|
29
|
+
return structuredResult(response.type);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SchemaTypeFieldSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
description: z.ZodNullable<z.ZodString>;
|
|
5
|
+
type: z.ZodString;
|
|
6
|
+
isNonNull: z.ZodBoolean;
|
|
7
|
+
isList: z.ZodBoolean;
|
|
8
|
+
deprecationReason: z.ZodNullable<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export declare const SchemaTypeEnumValueSchema: z.ZodObject<{
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
description: z.ZodNullable<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const SchemaTypeKindSchema: z.ZodEnum<{
|
|
15
|
+
OBJECT: "OBJECT";
|
|
16
|
+
INPUT_OBJECT: "INPUT_OBJECT";
|
|
17
|
+
ENUM: "ENUM";
|
|
18
|
+
UNION: "UNION";
|
|
19
|
+
INTERFACE: "INTERFACE";
|
|
20
|
+
SCALAR: "SCALAR";
|
|
21
|
+
UNKNOWN: "UNKNOWN";
|
|
22
|
+
}>;
|
|
23
|
+
export declare const SchemaTypeInfoSchema: z.ZodObject<{
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
kind: z.ZodEnum<{
|
|
26
|
+
OBJECT: "OBJECT";
|
|
27
|
+
INPUT_OBJECT: "INPUT_OBJECT";
|
|
28
|
+
ENUM: "ENUM";
|
|
29
|
+
UNION: "UNION";
|
|
30
|
+
INTERFACE: "INTERFACE";
|
|
31
|
+
SCALAR: "SCALAR";
|
|
32
|
+
UNKNOWN: "UNKNOWN";
|
|
33
|
+
}>;
|
|
34
|
+
description: z.ZodNullable<z.ZodString>;
|
|
35
|
+
fields: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
36
|
+
name: z.ZodString;
|
|
37
|
+
description: z.ZodNullable<z.ZodString>;
|
|
38
|
+
type: z.ZodString;
|
|
39
|
+
isNonNull: z.ZodBoolean;
|
|
40
|
+
isList: z.ZodBoolean;
|
|
41
|
+
deprecationReason: z.ZodNullable<z.ZodString>;
|
|
42
|
+
}, z.core.$strip>>>;
|
|
43
|
+
enumValues: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
44
|
+
name: z.ZodString;
|
|
45
|
+
description: z.ZodNullable<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>>>;
|
|
47
|
+
possibleTypes: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
48
|
+
interfaces: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export declare const GetSchemaTypeResponseSchema: z.ZodObject<{
|
|
51
|
+
type: z.ZodNullable<z.ZodObject<{
|
|
52
|
+
name: z.ZodString;
|
|
53
|
+
kind: z.ZodEnum<{
|
|
54
|
+
OBJECT: "OBJECT";
|
|
55
|
+
INPUT_OBJECT: "INPUT_OBJECT";
|
|
56
|
+
ENUM: "ENUM";
|
|
57
|
+
UNION: "UNION";
|
|
58
|
+
INTERFACE: "INTERFACE";
|
|
59
|
+
SCALAR: "SCALAR";
|
|
60
|
+
UNKNOWN: "UNKNOWN";
|
|
61
|
+
}>;
|
|
62
|
+
description: z.ZodNullable<z.ZodString>;
|
|
63
|
+
fields: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
64
|
+
name: z.ZodString;
|
|
65
|
+
description: z.ZodNullable<z.ZodString>;
|
|
66
|
+
type: z.ZodString;
|
|
67
|
+
isNonNull: z.ZodBoolean;
|
|
68
|
+
isList: z.ZodBoolean;
|
|
69
|
+
deprecationReason: z.ZodNullable<z.ZodString>;
|
|
70
|
+
}, z.core.$strip>>>;
|
|
71
|
+
enumValues: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
72
|
+
name: z.ZodString;
|
|
73
|
+
description: z.ZodNullable<z.ZodString>;
|
|
74
|
+
}, z.core.$strip>>>;
|
|
75
|
+
possibleTypes: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
76
|
+
interfaces: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
77
|
+
}, z.core.$strip>>;
|
|
78
|
+
error: z.ZodOptional<z.ZodString>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
export declare const getSchemaTypeOutputSchema: {
|
|
81
|
+
name: z.ZodOptional<z.ZodString>;
|
|
82
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
83
|
+
OBJECT: "OBJECT";
|
|
84
|
+
INPUT_OBJECT: "INPUT_OBJECT";
|
|
85
|
+
ENUM: "ENUM";
|
|
86
|
+
UNION: "UNION";
|
|
87
|
+
INTERFACE: "INTERFACE";
|
|
88
|
+
SCALAR: "SCALAR";
|
|
89
|
+
UNKNOWN: "UNKNOWN";
|
|
90
|
+
}>>;
|
|
91
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
92
|
+
fields: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
93
|
+
name: z.ZodString;
|
|
94
|
+
description: z.ZodNullable<z.ZodString>;
|
|
95
|
+
type: z.ZodString;
|
|
96
|
+
isNonNull: z.ZodBoolean;
|
|
97
|
+
isList: z.ZodBoolean;
|
|
98
|
+
deprecationReason: z.ZodNullable<z.ZodString>;
|
|
99
|
+
}, z.core.$strip>>>>;
|
|
100
|
+
enumValues: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
101
|
+
name: z.ZodString;
|
|
102
|
+
description: z.ZodNullable<z.ZodString>;
|
|
103
|
+
}, z.core.$strip>>>>;
|
|
104
|
+
possibleTypes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
105
|
+
interfaces: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
106
|
+
error: z.ZodOptional<z.ZodString>;
|
|
107
|
+
};
|
|
108
|
+
export type SchemaTypeField = z.infer<typeof SchemaTypeFieldSchema>;
|
|
109
|
+
export type SchemaTypeEnumValue = z.infer<typeof SchemaTypeEnumValueSchema>;
|
|
110
|
+
export type SchemaTypeKind = z.infer<typeof SchemaTypeKindSchema>;
|
|
111
|
+
export type SchemaTypeInfo = z.infer<typeof SchemaTypeInfoSchema>;
|
|
112
|
+
export type GetSchemaTypeResponse = z.infer<typeof GetSchemaTypeResponseSchema>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const SchemaTypeFieldSchema = z.object({
|
|
3
|
+
name: z.string().describe("Field name"),
|
|
4
|
+
description: z.string().nullable().describe("Field description"),
|
|
5
|
+
type: z.string().describe('GraphQL type (e.g., "String!", "[User!]!")'),
|
|
6
|
+
isNonNull: z.boolean().describe("Whether the field is non-nullable"),
|
|
7
|
+
isList: z.boolean().describe("Whether the field is a list type"),
|
|
8
|
+
deprecationReason: z.string().nullable().describe("Deprecation reason if the field is deprecated")
|
|
9
|
+
});
|
|
10
|
+
export const SchemaTypeEnumValueSchema = z.object({
|
|
11
|
+
name: z.string().describe("Enum value name"),
|
|
12
|
+
description: z.string().nullable().describe("Enum value description")
|
|
13
|
+
});
|
|
14
|
+
export const SchemaTypeKindSchema = z.enum([
|
|
15
|
+
"OBJECT",
|
|
16
|
+
"INPUT_OBJECT",
|
|
17
|
+
"ENUM",
|
|
18
|
+
"UNION",
|
|
19
|
+
"INTERFACE",
|
|
20
|
+
"SCALAR",
|
|
21
|
+
"UNKNOWN"
|
|
22
|
+
]);
|
|
23
|
+
export const SchemaTypeInfoSchema = z.object({
|
|
24
|
+
name: z.string().describe("Type name"),
|
|
25
|
+
kind: SchemaTypeKindSchema.describe("The kind of GraphQL type"),
|
|
26
|
+
description: z.string().nullable().describe("Type description"),
|
|
27
|
+
fields: z.array(SchemaTypeFieldSchema).nullable().describe("Fields for OBJECT, INPUT_OBJECT, and INTERFACE types"),
|
|
28
|
+
enumValues: z.array(SchemaTypeEnumValueSchema).nullable().describe("Values for ENUM types"),
|
|
29
|
+
possibleTypes: z.array(z.string()).nullable().describe("Possible types for UNION types"),
|
|
30
|
+
interfaces: z.array(z.string()).nullable().describe("Implemented interfaces for OBJECT types")
|
|
31
|
+
});
|
|
32
|
+
export const GetSchemaTypeResponseSchema = z.object({
|
|
33
|
+
type: SchemaTypeInfoSchema.nullable(),
|
|
34
|
+
error: z.string().optional().describe("Error message if type not found")
|
|
35
|
+
});
|
|
36
|
+
export const getSchemaTypeOutputSchema = {
|
|
37
|
+
name: z.string().optional().describe("Type name"),
|
|
38
|
+
kind: SchemaTypeKindSchema.optional().describe("The kind of GraphQL type"),
|
|
39
|
+
description: z.string().nullable().optional().describe("Type description"),
|
|
40
|
+
fields: z.array(SchemaTypeFieldSchema).nullable().optional().describe("Fields for OBJECT, INPUT_OBJECT, and INTERFACE types"),
|
|
41
|
+
enumValues: z.array(SchemaTypeEnumValueSchema).nullable().optional().describe("Values for ENUM types"),
|
|
42
|
+
possibleTypes: z.array(z.string()).nullable().optional().describe("Possible types for UNION types"),
|
|
43
|
+
interfaces: z.array(z.string()).nullable().optional().describe("Implemented interfaces for OBJECT types"),
|
|
44
|
+
error: z.string().optional().describe("Error message if type not found")
|
|
45
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getSchemaTypeDefinitionTool: any;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineMcpTool } from "#imports";
|
|
3
|
+
import { fetchFromMcpHandler, structuredResult } from "./../../utils/index.js";
|
|
4
|
+
import {
|
|
5
|
+
getSchemaTypeDefinitionOutputSchema
|
|
6
|
+
} from "./types.js";
|
|
7
|
+
export const getSchemaTypeDefinitionTool = defineMcpTool({
|
|
8
|
+
name: "schema-get-type-definition",
|
|
9
|
+
title: "Get Type Definition",
|
|
10
|
+
description: "Get the full SDL (Schema Definition Language) definition of a GraphQL type. Returns the complete type definition as it appears in the schema, including all fields, arguments, directives, and descriptions.",
|
|
11
|
+
annotations: {
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
destructiveHint: false,
|
|
14
|
+
idempotentHint: true,
|
|
15
|
+
openWorldHint: false
|
|
16
|
+
},
|
|
17
|
+
inputSchema: {
|
|
18
|
+
typeName: z.string().describe(
|
|
19
|
+
'The name of the GraphQL type to get the definition for (e.g., "User", "CreateUserInput", "UserRole")'
|
|
20
|
+
)
|
|
21
|
+
},
|
|
22
|
+
outputSchema: getSchemaTypeDefinitionOutputSchema,
|
|
23
|
+
handler: async ({ typeName }) => {
|
|
24
|
+
const response = await fetchFromMcpHandler(
|
|
25
|
+
"schema-get-type-definition",
|
|
26
|
+
{ name: typeName }
|
|
27
|
+
);
|
|
28
|
+
return structuredResult({
|
|
29
|
+
definition: response.definition,
|
|
30
|
+
error: response.error
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const GetSchemaTypeDefinitionResponseSchema: z.ZodObject<{
|
|
3
|
+
definition: z.ZodNullable<z.ZodString>;
|
|
4
|
+
error: z.ZodOptional<z.ZodString>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export declare const getSchemaTypeDefinitionOutputSchema: {
|
|
7
|
+
definition: z.ZodNullable<z.ZodString>;
|
|
8
|
+
error: z.ZodOptional<z.ZodString>;
|
|
9
|
+
};
|
|
10
|
+
export type GetSchemaTypeDefinitionResponse = z.infer<typeof GetSchemaTypeDefinitionResponseSchema>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const GetSchemaTypeDefinitionResponseSchema = z.object({
|
|
3
|
+
definition: z.string().nullable().describe("The full SDL definition of the type"),
|
|
4
|
+
error: z.string().optional().describe("Error message if the type was not found")
|
|
5
|
+
});
|
|
6
|
+
export const getSchemaTypeDefinitionOutputSchema = {
|
|
7
|
+
definition: z.string().nullable().describe("The full SDL definition of the type"),
|
|
8
|
+
error: z.string().optional().describe("Error message if the type was not found")
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getTypeUsageTool: any;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineMcpTool } from "#imports";
|
|
3
|
+
import { fetchFromMcpHandler, structuredResult } from "./../../utils/index.js";
|
|
4
|
+
import { getTypeUsageOutputSchema } from "./types.js";
|
|
5
|
+
export const getTypeUsageTool = defineMcpTool({
|
|
6
|
+
name: "schema-get-type-usage",
|
|
7
|
+
title: "Get Type Usage",
|
|
8
|
+
description: "Find all places where a GraphQL type is used in the schema. Shows where a type appears as a field return type, argument type, or input field type.",
|
|
9
|
+
annotations: {
|
|
10
|
+
readOnlyHint: true,
|
|
11
|
+
destructiveHint: false,
|
|
12
|
+
idempotentHint: true,
|
|
13
|
+
openWorldHint: false
|
|
14
|
+
},
|
|
15
|
+
inputSchema: {
|
|
16
|
+
typeName: z.string().describe(
|
|
17
|
+
'The name of the GraphQL type to find usages for (e.g., "User", "ID", "DateTime")'
|
|
18
|
+
)
|
|
19
|
+
},
|
|
20
|
+
outputSchema: getTypeUsageOutputSchema,
|
|
21
|
+
handler: async ({ typeName }) => {
|
|
22
|
+
const response = await fetchFromMcpHandler(
|
|
23
|
+
"schema-get-type-usage",
|
|
24
|
+
{ name: typeName }
|
|
25
|
+
);
|
|
26
|
+
if (response.error) {
|
|
27
|
+
return structuredResult({ error: response.error });
|
|
28
|
+
}
|
|
29
|
+
return structuredResult({
|
|
30
|
+
typeName: response.typeName,
|
|
31
|
+
count: response.usages.length,
|
|
32
|
+
usages: response.usages
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const TypeUsageLocationSchema: z.ZodObject<{
|
|
3
|
+
typeName: z.ZodString;
|
|
4
|
+
fieldName: z.ZodString;
|
|
5
|
+
usageType: z.ZodEnum<{
|
|
6
|
+
return_type: "return_type";
|
|
7
|
+
argument: "argument";
|
|
8
|
+
input_field: "input_field";
|
|
9
|
+
}>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export declare const GetTypeUsageResponseSchema: z.ZodObject<{
|
|
12
|
+
typeName: z.ZodString;
|
|
13
|
+
usages: z.ZodArray<z.ZodObject<{
|
|
14
|
+
typeName: z.ZodString;
|
|
15
|
+
fieldName: z.ZodString;
|
|
16
|
+
usageType: z.ZodEnum<{
|
|
17
|
+
return_type: "return_type";
|
|
18
|
+
argument: "argument";
|
|
19
|
+
input_field: "input_field";
|
|
20
|
+
}>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
error: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export declare const getTypeUsageOutputSchema: {
|
|
25
|
+
typeName: z.ZodOptional<z.ZodString>;
|
|
26
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
usages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
28
|
+
typeName: z.ZodString;
|
|
29
|
+
fieldName: z.ZodString;
|
|
30
|
+
usageType: z.ZodEnum<{
|
|
31
|
+
return_type: "return_type";
|
|
32
|
+
argument: "argument";
|
|
33
|
+
input_field: "input_field";
|
|
34
|
+
}>;
|
|
35
|
+
}, z.core.$strip>>>;
|
|
36
|
+
error: z.ZodOptional<z.ZodString>;
|
|
37
|
+
};
|
|
38
|
+
export type TypeUsageLocation = z.infer<typeof TypeUsageLocationSchema>;
|
|
39
|
+
export type GetTypeUsageResponse = z.infer<typeof GetTypeUsageResponseSchema>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const TypeUsageLocationSchema = z.object({
|
|
3
|
+
typeName: z.string().describe("The type where this type is used"),
|
|
4
|
+
fieldName: z.string().describe("The field name"),
|
|
5
|
+
usageType: z.enum(["return_type", "argument", "input_field"]).describe("How the type is used")
|
|
6
|
+
});
|
|
7
|
+
export const GetTypeUsageResponseSchema = z.object({
|
|
8
|
+
typeName: z.string().describe("The type being searched for"),
|
|
9
|
+
usages: z.array(TypeUsageLocationSchema),
|
|
10
|
+
error: z.string().optional().describe("Error message if type not found")
|
|
11
|
+
});
|
|
12
|
+
export const getTypeUsageOutputSchema = {
|
|
13
|
+
typeName: z.string().optional().describe("The type being searched for"),
|
|
14
|
+
count: z.number().optional().describe("Number of usages found"),
|
|
15
|
+
usages: z.array(TypeUsageLocationSchema).optional().describe("Locations where the type is used"),
|
|
16
|
+
error: z.string().optional().describe("Error message if type not found")
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getUnionMembersTool: any;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineMcpTool } from "#imports";
|
|
3
|
+
import { fetchFromMcpHandler, structuredResult } from "./../../utils/index.js";
|
|
4
|
+
import {
|
|
5
|
+
getUnionMembersOutputSchema
|
|
6
|
+
} from "./types.js";
|
|
7
|
+
export const getUnionMembersTool = defineMcpTool({
|
|
8
|
+
name: "schema-get-union-members",
|
|
9
|
+
title: "Get Union Members",
|
|
10
|
+
description: "Get all types that are members of a GraphQL union. Returns the member type names and descriptions.",
|
|
11
|
+
annotations: {
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
destructiveHint: false,
|
|
14
|
+
idempotentHint: true,
|
|
15
|
+
openWorldHint: false
|
|
16
|
+
},
|
|
17
|
+
inputSchema: {
|
|
18
|
+
unionName: z.string().describe('The name of the GraphQL union (e.g., "SearchResult")')
|
|
19
|
+
},
|
|
20
|
+
outputSchema: getUnionMembersOutputSchema,
|
|
21
|
+
handler: async ({ unionName }) => {
|
|
22
|
+
const response = await fetchFromMcpHandler(
|
|
23
|
+
"schema-get-union-members",
|
|
24
|
+
{ name: unionName }
|
|
25
|
+
);
|
|
26
|
+
if (response.error) {
|
|
27
|
+
return structuredResult({ error: response.error });
|
|
28
|
+
}
|
|
29
|
+
return structuredResult({
|
|
30
|
+
unionName: response.unionName,
|
|
31
|
+
count: response.members.length,
|
|
32
|
+
members: response.members
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const UnionMemberSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
description: z.ZodNullable<z.ZodString>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export declare const GetUnionMembersResponseSchema: z.ZodObject<{
|
|
7
|
+
unionName: z.ZodString;
|
|
8
|
+
members: z.ZodArray<z.ZodObject<{
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
description: z.ZodNullable<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
error: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const getUnionMembersOutputSchema: {
|
|
15
|
+
unionName: z.ZodOptional<z.ZodString>;
|
|
16
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
members: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
18
|
+
name: z.ZodString;
|
|
19
|
+
description: z.ZodNullable<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>>>;
|
|
21
|
+
error: z.ZodOptional<z.ZodString>;
|
|
22
|
+
};
|
|
23
|
+
export type UnionMember = z.infer<typeof UnionMemberSchema>;
|
|
24
|
+
export type GetUnionMembersResponse = z.infer<typeof GetUnionMembersResponseSchema>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const UnionMemberSchema = z.object({
|
|
3
|
+
name: z.string().describe("Type name"),
|
|
4
|
+
description: z.string().nullable().describe("Type description")
|
|
5
|
+
});
|
|
6
|
+
export const GetUnionMembersResponseSchema = z.object({
|
|
7
|
+
unionName: z.string().describe("The union name"),
|
|
8
|
+
members: z.array(UnionMemberSchema),
|
|
9
|
+
error: z.string().optional().describe("Error message if union not found")
|
|
10
|
+
});
|
|
11
|
+
export const getUnionMembersOutputSchema = {
|
|
12
|
+
unionName: z.string().optional().describe("The union name"),
|
|
13
|
+
count: z.number().optional().describe("Number of union members"),
|
|
14
|
+
members: z.array(UnionMemberSchema).optional().describe("Types that are part of the union"),
|
|
15
|
+
error: z.string().optional().describe("Error message if union not found")
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const listSchemaTypesTool: any;
|