Skip to main content
Glama

introspect_model

List all fields and their types for a Gadget model. Use this to discover available fields when unsure.

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

TableJSON Schema
NameRequiredDescriptionDefault
modelYesModel name in camelCase, e.g. shopifyOrder, label, shopifyShop

Implementation Reference

  • The main handler for the 'introspect_model' tool. It takes a 'model' argument (camelCase), constructs a GraphQL introspection query to get the model type's fields, and returns the type information as JSON.
    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) }] };
    }
  • The tool definition/input schema registration for 'introspect_model'. Defines the tool name, description, and required 'model' string parameter.
    {
      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",
          },
        },
      },
  • src/index.ts:48-53 (registration)
    Registration of the tool definitions (including introspect_model) with the MCP server via ListToolsRequestSchema, and dispatching tool calls via CallToolRequestSchema which calls handleTool.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOL_DEFINITIONS }));
    
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
      return handleTool(name, (args ?? {}) as Record<string, any>);
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. Only states listing action with no disclosure of read-only nature, error handling, or performance implications. Minimal behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with purpose and usage. No redundant or missing words. Highly efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Simple tool with one parameter and no output schema. Description covers purpose and usage. Could mention return format but not essential. Adequate for the context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with clear parameter description. The tool description adds little beyond stating 'for a Gadget model', which is already implicit. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states 'List all fields and their types for a Gadget model' with a specific verb and resource. Distinct from sibling tools like list_models, introspect_actions, etc.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly recommends running this tool 'first when you're unsure what fields exist on a model.' Provides a usage context but does not name alternatives or exclusions explicitly.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Stronger-eCommerce/gadget-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server