UNPKG

bc-webclient-mcp

Version:

Model Context Protocol (MCP) server for Microsoft Dynamics 365 Business Central via WebUI protocol. Enables AI assistants to interact with BC through the web client protocol, supporting Card, List, and Document pages with full line item support and server

77 lines 2.73 kB
/** * Update Record MCP Tool * * Convenience helper that combines get_page_metadata and write_page_data * to update a record in a single call. * * This is a composite tool that simplifies common workflows. */ import { BaseMCPTool } from '../base-tool.js'; import type { Result } from '../../core/result.js'; import type { BCError } from '../../core/errors.js'; import type { IBCConnection } from '../../core/interfaces.js'; import type { UpdateRecordInput, UpdateRecordOutput } from '../../types/mcp-types.js'; import type { AuditLogger } from '../../services/audit-logger.js'; /** * MCP Tool: update_record * * Updates a record by combining page opening and field updates in one call. */ export declare class UpdateRecordTool extends BaseMCPTool { private readonly connection; private readonly bcConfig?; readonly name = "update_record"; readonly description: string; readonly inputSchema: { type: string; properties: { pageId: { type: string[]; description: string; }; pageContextId: { type: string; description: string; }; fields: { type: string; description: string; additionalProperties: boolean; }; }; required: string[]; }; readonly requiresConsent = true; readonly sensitivityLevel: "medium"; readonly consentPrompt = "Update an existing record in Business Central? This will modify data in your Business Central database."; private readonly getPageMetadataTool; private readonly writePageDataTool; private readonly executeActionTool; constructor(connection: IBCConnection, bcConfig?: { baseUrl: string; username: string; password: string; tenantId: string; } | undefined, auditLogger?: AuditLogger); /** * Validates and extracts input. */ protected validateInput(input: unknown): Result<UpdateRecordInput, BCError>; /** * Executes the tool to update a record. */ protected executeInternal(input: unknown): Promise<Result<UpdateRecordOutput, BCError>>; /** Extract options with defaults */ private extractOptions; /** Get existing page context or open new page */ private getOrOpenPage; /** Activate edit mode on the page */ private activateEditMode; /** Write field values to the page */ private writeFieldValues; /** Save changes if save is enabled and fields were updated */ private saveChangesIfNeeded; /** Build the final update result */ private buildUpdateResult; } //# sourceMappingURL=update-record-tool.d.ts.map