AroFlo: Get Record
aroflo_get_recordFetch a specific AroFlo record by specifying zone, ID field, and value. Add extraWhere clauses for filtering and choose output modes like data or verbose.
Instructions
Fetch one specific AroFlo record by zone and ID field/value. Use extraWhere for additional pipe-delimited clauses like "and|archived|=|false".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| zone | Yes | ||
| idField | Yes | ||
| idValue | Yes | ||
| extraWhere | No | ||
| mode | No | ||
| verbose | No | ||
| debug | No | ||
| raw | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp/tools/get-record.ts:41-79 (handler)The tool handler function for 'aroflo_get_record' which calls the AroFlo client to fetch records.
async (args) => { const mode = resolveOutputMode(args); const envelopeRequested = typeof args.mode === 'string' || Boolean(args.raw) || Boolean(args.verbose); try { const extraWhere = typeof args.extraWhere === 'string' ? [args.extraWhere] : args.extraWhere; const where = [`and|${args.idField}|=|${String(args.idValue)}`, ...(extraWhere ?? [])]; const response = await client.get(args.zone, { where, page: 1, pageSize: 1 }); if (!envelopeRequested) { return successToolResult(response); } const out = buildZoneDataEnvelope({ zone: args.zone, response, page: 1, pageSize: 1, mode, debug: mode === 'debug' || mode === 'raw' ? { zone: args.zone, normalizedParams: { where, page: 1, pageSize: 1 } } : undefined }); return successToolResult(out); } catch (error) { return errorToolResult(error, { mode, debug: { zone: args.zone, idField: args.idField } }); } } - src/mcp/tools/get-record.ts:10-21 (schema)Zod schema definition for the input arguments of the tool.
const inputSchema = { zone: z.string().min(1), idField: z.string().min(1), // JSON Schema cannot represent BigInt, so accept string/number only. // For large numeric IDs, pass them as strings. idValue: z.union([z.string().min(1), z.number()]), extraWhere: stringOrStringArraySchema.optional(), mode: z.enum(['data', 'verbose', 'debug', 'raw']).optional(), verbose: z.boolean().optional(), debug: z.boolean().optional(), raw: z.boolean().optional() }; - src/mcp/tools/get-record.ts:23-40 (registration)Registration of the 'aroflo_get_record' tool with the MCP server.
export function registerGetRecordTool(server: McpServer, client: AroFloClient): void { server.registerTool( 'aroflo_get_record', { title: 'AroFlo: Get Record', description: 'Fetch one specific AroFlo record by zone and ID field/value. ' + 'Use extraWhere for additional pipe-delimited clauses like "and|archived|=|false".', inputSchema, // MCP SDK expects output schemas to be object schemas (or raw object shapes). // `z.any()` causes output validation to crash under the current SDK. outputSchema: z.object({}).passthrough(), annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true } },