Skip to main content
Glama
sanggggg

Record MCP Server

by sanggggg

add_review_record

Add a new review record to a custom type for storing evaluations of items like coffee, whisky, or wine, using defined schemas to organize data.

Instructions

Add a new review record to a type

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNameYesName of the review type
dataYesReview data matching the type schema

Implementation Reference

  • The `addRecord` function that executes the core tool logic: validates parameters, checks type existence, validates data against schema, generates record ID, appends to storage, and returns success info.
    export async function addRecord(
      storage: StorageProvider,
      params: AddRecordParams
    ): Promise<AddRecordResult> {
      // Validate type name
      const typeName = validateTypeName(params.typeName);
    
      // Check if type exists
      const exists = await storage.typeExists(typeName);
      if (!exists) {
        throw new Error(`Review type "${typeName}" does not exist`);
      }
    
      // Read existing type data
      const typeData = await storage.readType(typeName);
    
      // Validate record against schema
      validateRecordAgainstSchema(params.data, typeData.schema);
    
      // Create new record
      const recordId = generateId();
      const newRecord: ReviewRecord = {
        id: recordId,
        data: params.data as Record<string, string | number | boolean>,
        createdAt: getCurrentTimestamp(),
      };
    
      // Add record to type
      typeData.records.push(newRecord);
      typeData.updatedAt = getCurrentTimestamp();
    
      // Save updated type data
      await storage.writeType(typeName, typeData);
    
      return {
        success: true,
        typeName,
        recordId,
        message: `Record added to "${typeName}" with ID: ${recordId}`,
      };
    }
  • Input schema definition for the `add_review_record` tool, specifying `typeName` and `data` parameters.
    inputSchema: {
      type: "object",
      properties: {
        typeName: {
          type: "string",
          description: "Name of the review type",
        },
        data: {
          type: "object",
          description: "Review data matching the type schema",
        },
      },
      required: ["typeName", "data"],
    },
  • src/index.ts:107-124 (registration)
    Registration of the `add_review_record` tool in the TOOLS array, including name, description, and input schema.
    {
      name: "add_review_record",
      description: "Add a new review record to a type",
      inputSchema: {
        type: "object",
        properties: {
          typeName: {
            type: "string",
            description: "Name of the review type",
          },
          data: {
            type: "object",
            description: "Review data matching the type schema",
          },
        },
        required: ["typeName", "data"],
      },
    },
  • src/index.ts:220-234 (registration)
    Dispatch handler in the CallToolRequest switch statement that invokes `addRecord` with parsed arguments and formats the response.
    case "add_review_record": {
      const params = args as { typeName: string; data: Record<string, unknown> };
      if (!params?.typeName || !params?.data) {
        throw new Error("typeName and data are required");
      }
      const result = await addRecord(storage, params);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Add' implies a write/mutation operation, the description doesn't address important behavioral aspects like whether this requires specific permissions, what happens on duplicate records, whether the operation is idempotent, or what the response looks like. For a mutation tool with zero annotation coverage, this represents a significant gap.

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 extremely concise - a single sentence that directly states the tool's purpose without any unnecessary words. It's front-loaded with the core functionality and wastes no space on redundant information.

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

Completeness2/5

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

For a mutation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what constitutes a successful operation, what errors might occur, how to interpret results, or how this tool relates to the sibling tools in the ecosystem. The agent would struggle to use this tool effectively without additional 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?

The schema description coverage is 100%, so both parameters are already documented in the schema. The description adds minimal value beyond what the schema provides - it mentions 'type' which relates to 'typeName' and 'review data' which relates to 'data', but doesn't provide additional context about format requirements, validation rules, or example usage.

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

Purpose4/5

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

The description clearly states the action ('Add a new review record') and target resource ('to a type'), providing a specific verb+resource combination. However, it doesn't differentiate this tool from its siblings like 'add_review_type' or 'add_field_to_type', which would require explaining that this tool adds data records rather than schema definitions.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'add_review_type' (which creates review types) or 'add_field_to_type' (which modifies type schemas). There's no mention of prerequisites, sequencing, or contextual factors that would help an agent choose between these related tools.

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/sanggggg/record-mcp'

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