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
| Name | Required | Description | Default |
|---|---|---|---|
| recordId | Yes | ID of the record to retrieve | |
| resourceUri | Yes | URI of the resource |
Implementation Reference
- src/core/MCPServer.ts:205-213 (handler)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 }; }); }
- src/core/MCPServer.ts:144-147 (registration)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), },
- src/types/index.ts:77-80 (schema)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'), });
- src/types/index.ts:108-108 (schema)TypeScript type inferred from the GetRecordArgsSchema.export type GetRecordArgs = z.infer<typeof GetRecordArgsSchema>;