Skip to main content
Glama

create_record

Generate a new record in a specified resource by providing the resource URI and required data. Streamline data management within MCP servers using structured inputs.

Instructions

Create a new record in a resource

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesRecord data to create
resourceUriYesURI of the resource

Implementation Reference

  • Handler implementation for the 'create_record' tool. Validates input using CreateRecordArgsSchema and delegates creation to the data service.
    case 'create_record': {
      return await safeExecute(toolName, async () => {
        const args = validateInput(CreateRecordArgsSchema, request.params.arguments);
        const record = await this.dataService.createRecord(args.resourceUri, args.data);
        return record;
      });
    }
  • Registration of the 'create_record' tool in the list_tools handler, including name, description, and input schema reference.
    {
      name: 'create_record',
      description: 'Create a new record in a resource',
      inputSchema: getInputSchema(CreateRecordArgsSchema),
    },
  • Zod schema defining the input arguments for the create_record tool: resourceUri and data.
    export const CreateRecordArgsSchema = z.object({
      resourceUri: z.string().describe('URI of the resource'),
      data: z.record(z.unknown()).describe('Record data to create'),
    });
  • Example concrete implementation of createRecord method in InMemoryDataService, which the tool handler calls via dataService.
    public async createRecord(
      uri: string, 
      data: Record<string, unknown>
    ): Promise<Record<string, unknown>> {
      this.validateResource(uri);
      
      const id = data.id as string || uuidv4();
      const timestamp = new Date().toISOString();
      
      const record = {
        id,
        ...data,
        createdAt: timestamp,
        updatedAt: timestamp
      };
      
      this.data.get(uri)!.set(id, record);
      return record;
    }
  • Type signature for createRecord method in IDataService interface, defining the contract called by the tool handler.
    createRecord(_uri: string, _data: { [key: string]: unknown }): Promise<{ [key: string]: unknown }>;
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. It states the tool creates a record but fails to mention critical aspects like whether this is a mutating operation, what permissions are needed, error handling, or response format. This leaves significant gaps in understanding the tool's behavior.

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 a single, direct sentence with zero wasted words, making it highly concise and front-loaded. It efficiently communicates the core purpose without unnecessary elaboration.

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?

Given the complexity of a creation tool with no annotations and no output schema, the description is insufficient. It lacks details on behavioral traits, error cases, and what the tool returns, leaving the agent with incomplete context for safe and effective use.

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 description coverage is 100%, so the input schema already documents both parameters ('resourceUri' and 'data') adequately. The description adds no additional semantic context beyond implying these parameters are used for creation, which is minimal value over the schema.

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 ('Create') and target ('new record in a resource'), which is specific and unambiguous. However, it doesn't differentiate from sibling tools like 'update_record' or 'delete_record' beyond the basic verb, missing explicit scope distinctions.

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?

No guidance is provided on when to use this tool versus alternatives like 'update_record' or 'delete_record'. The description lacks context about prerequisites, such as whether the resource must exist or if authentication is required, leaving the agent without usage direction.

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

Related 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/kbhuw/MCP_TEMPLATE'

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