introspect_model
Discover all fields and their data types for any Gadget model to understand available data structure and plan queries effectively.
Instructions
List all fields and their types for a Gadget model. Run this first when you're unsure what fields exist on a model.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Model name in camelCase, e.g. shopifyOrder, label, shopifyShop |
Implementation Reference
- src/tools.ts:61-86 (handler)The handler logic for the introspect_model tool, which performs a GraphQL introspection query for a given model type.
case "introspect_model": { const { model } = args as { model: string }; const typeName = model.charAt(0).toUpperCase() + model.slice(1); const data = await gql(` query IntrospectModel($name: String!) { __type(name: $name) { name fields { name description type { name kind ofType { name kind } } } } } `, { name: typeName }); if (!data.__type) { return { content: [{ type: "text", text: `No type found for "${typeName}". Try list_models to see available model names, then adjust casing.` }], }; } return { content: [{ type: "text", text: JSON.stringify(data.__type, null, 2) }] }; } - src/tools.ts:164-178 (registration)The registration definition for the introspect_model tool, including its schema and description.
{ name: "introspect_model", description: "List all fields and their types for a Gadget model. Run this first when you're unsure what fields exist on a model.", inputSchema: { type: "object", required: ["model"], properties: { model: { type: "string", description: "Model name in camelCase, e.g. shopifyOrder, label, shopifyShop", }, }, }, },