get_schema_overview
Get all models, fields, and types in one request. Understand the app schema broadly before exploring specific models.
Instructions
Return all models with their fields and types in a single call. Use this for a broad understanding of the app schema before diving into specific models.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:374-428 (handler)The handler case for 'get_schema_overview' inside the handleTool function. It runs a GraphQL introspection query to fetch the full schema (queryType fields and all types), identifies model names from Connection return types, filters OBJECT types matching those model names, and returns their fields with types and descriptions.
case "get_schema_overview": { const data = await gql(` query { __schema { queryType { fields { name type { kind name ofType { kind name } } } } types { name kind description fields { name description type { name kind ofType { name kind ofType { name kind } } } } } } } `); // Identify model names from Connection return types in query fields const modelNames = new Set<string>(); for (const f of data.__schema.queryType.fields as any[]) { let t = f.type; if (t?.kind === "NON_NULL") t = t.ofType; if (t?.name?.endsWith("Connection")) { modelNames.add(t.name.replace(/Connection$/, "")); } } const models = (data.__schema.types as any[]) .filter((t) => modelNames.has(t.name) && t.kind === "OBJECT") .map((t) => ({ name: t.name, description: t.description ?? "", fields: (t.fields ?? []).map((f: any) => ({ name: f.name, type: typeString(f.type), description: f.description ?? "", })), })) .sort((a, b) => a.name.localeCompare(b.name)); return { content: [{ type: "text", text: JSON.stringify(models, null, 2) }] }; } - src/tools.ts:546-550 (registration)Tool registration entry for 'get_schema_overview' in the TOOL_DEFINITIONS array. Defines its name, description ('Return all models with their fields and types in a single call...'), and empty input schema (no parameters required).
name: "get_schema_overview", description: "Return all models with their fields and types in a single call. Use this for a broad understanding of the app schema before diving into specific models.", inputSchema: { type: "object", properties: {} }, }, - src/tools.ts:57-62 (helper)The typeString helper function used within the handler to convert GraphQL type metadata (handling NON_NULL, LIST nesting) into a human-readable type string (e.g., 'String!', '[LabelFilter!]').
function typeString(t: any): string { if (!t) return "String"; if (t.kind === "NON_NULL") return `${typeString(t.ofType)}!`; if (t.kind === "LIST") return `[${typeString(t.ofType)}]`; return t.name ?? "String"; }