Skip to main content
Glama

get_record

Retrieve a specific record by ID from a resource using the resource URI and record ID for precise data access and management in MCP Template servers.

Instructions

Get a specific record by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
recordIdYesID of the record to retrieve
resourceUriYesURI of the resource

Implementation Reference

  • The handler logic for the 'get_record' tool in the handleCallTool switch statement. It validates input, fetches the resource, and returns a placeholder record info.
    case 'get_record': {
      return await safeExecute(toolName, async () => {
        const args = validateInput(GetRecordArgsSchema, request.params.arguments);
        const resource = await this.dataService.getResource(args.resourceUri);
        // In a real implementation, you would fetch the specific record
        // This is a placeholder for the template
        return { id: args.recordId, resource: resource.name };
      });
    }
  • Registration of the 'get_record' tool in the handleListTools method, including name, description, and input schema reference.
      name: 'get_record',
      description: 'Get a specific record by ID',
      inputSchema: getInputSchema(GetRecordArgsSchema),
    },
  • Zod schema definition for GetRecordArgs used by the 'get_record' tool.
    export const GetRecordArgsSchema = z.object({
      resourceUri: z.string().describe('URI of the resource'),
      recordId: z.string().describe('ID of the record to retrieve'),
    });
  • TypeScript type inferred from the GetRecordArgsSchema.
    export type GetRecordArgs = z.infer<typeof GetRecordArgsSchema>;
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