Skip to main content
Glama

get_record

Retrieve a single record from a Gadget app by providing its model name, record ID, and desired fields.

Instructions

Get a single Gadget record by ID. Specify the model name, record ID, and fields to return.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesModel name in camelCase, e.g. shopifyOrder, label
idYesRecord ID
fieldsYesGraphQL field selection, e.g. "id name email createdAt"

Implementation Reference

  • The handler case for 'get_record' in the handleTool switch statement. It extracts {model, id, fields} from args, builds a GraphQL query to fetch a single record by ID, executes it via the gql() helper, and returns the record data as JSON.
    case "get_record": {
      const { model, id, fields } = args as { model: string; id: string; fields: string };
      const query = `
        query GetRecord($id: GadgetID!) {
          ${model}(id: $id) {
            ${fields}
          }
        }
      `;
      const data = await gql(query, { id });
      return { content: [{ type: "text", text: JSON.stringify(data[model], null, 2) }] };
    }
  • The tool definition/schema for 'get_record' in the TOOL_DEFINITIONS array. Specifies the name, description, required arguments (model, id, fields), and the input schema properties.
    {
      name: "get_record",
      description: "Get a single Gadget record by ID. Specify the model name, record ID, and fields to return.",
      inputSchema: {
        type: "object",
        required: ["model", "id", "fields"],
        properties: {
          model: { type: "string", description: "Model name in camelCase, e.g. shopifyOrder, label" },
          id: { type: "string", description: "Record ID" },
          fields: { type: "string", description: "GraphQL field selection, e.g. \"id name email createdAt\"" },
        },
      },
    },
  • src/index.ts:48-53 (registration)
    The MCP server registration that wires up the tool. TOOL_DEFINITIONS is exposed via ListToolsRequestSchema, and the handler function handleTool (which contains the get_record case) is called via CallToolRequestSchema.
    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>);
    });
Behavior3/5

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

No annotations are provided, so the description must disclose behavior. It indicates a read operation ('Get'), but does not mention idempotency, data limits, or error handling. The description is adequate for a simple read but lacks depth.

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?

The description is two sentences long with no extraneous words. Every sentence is useful, and the structure is focused.

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

Completeness3/5

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

The tool has no output schema, so the description should hint at the return format. It does not. However, given it is a simple single-record getter, the description is minimally complete. It could mention that the response is a JSON object with the requested fields.

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?

All three parameters have descriptions in the schema (100% coverage), so the baseline is 3. The description merely restates the parameter names without adding new semantic information beyond what the schema provides.

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?

The description clearly states the verb 'Get', the resource 'Gadget record', and the key parameters (model name, record ID, fields). It distinguishes itself from siblings like 'query_records' or 'list_models' by focusing on a single record retrieval.

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

Usage Guidelines3/5

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

The description implies usage for fetching a single record by ID, which contrasts with listing or querying tools. However, it does not explicitly state when to use it versus alternatives like 'query_records', nor does it provide when-not conditions.

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