AroFlo: Create/Update Record
aroflo_create_or_update_recordCreate or update records in AroFlo by specifying zone and XML data to manage quotes, projects, and labor reporting.
Instructions
Create or update a record in AroFlo using zone + postxml.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| zone | Yes | ||
| postxml | Yes | ||
| extra | No | ||
| mode | No | ||
| verbose | No | ||
| debug | No | ||
| raw | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp/tools/mutate-record.ts:33-57 (handler)The handler function that executes the AroFlo 'aroflo_create_or_update_record' tool logic by calling the client.post method.
async (args) => { const mode = resolveOutputMode(args); const envelopeRequested = typeof args.mode === 'string' || Boolean(args.raw) || Boolean(args.verbose); try { const response = await client.post(args.zone, args.postxml, { extra: args.extra }); if (!envelopeRequested) { return successToolResult(response); } const out = buildMutationEnvelope({ zone: args.zone, response, mode, debug: mode === 'debug' || mode === 'raw' ? { zone: args.zone } : undefined }); return successToolResult(out); } catch (error) { return errorToolResult(error, { mode, debug: { zone: args.zone } }); } } - src/mcp/tools/mutate-record.ts:18-59 (registration)Registration of the 'aroflo_create_or_update_record' tool with the MCP server.
export function registerMutateRecordTool(server: McpServer, client: AroFloClient): void { server.registerTool( 'aroflo_create_or_update_record', { title: 'AroFlo: Create/Update Record', description: 'Create or update a record in AroFlo using zone + postxml.', 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: { destructiveHint: true, openWorldHint: true } }, async (args) => { const mode = resolveOutputMode(args); const envelopeRequested = typeof args.mode === 'string' || Boolean(args.raw) || Boolean(args.verbose); try { const response = await client.post(args.zone, args.postxml, { extra: args.extra }); if (!envelopeRequested) { return successToolResult(response); } const out = buildMutationEnvelope({ zone: args.zone, response, mode, debug: mode === 'debug' || mode === 'raw' ? { zone: args.zone } : undefined }); return successToolResult(out); } catch (error) { return errorToolResult(error, { mode, debug: { zone: args.zone } }); } } ); } - src/mcp/tools/mutate-record.ts:8-16 (schema)Input schema definition for the 'aroflo_create_or_update_record' tool.
const inputSchema = { zone: z.string().min(1), postxml: z.string().min(1), extra: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).optional(), mode: z.enum(['data', 'verbose', 'debug', 'raw']).optional(), verbose: z.boolean().optional(), debug: z.boolean().optional(), raw: z.boolean().optional() };