← INDEXCH 09 / 1010 DEMONSTRATOR →

CHAPTER 09MCP Interface

Req. prefix: MCv0.2 draft

HiLo.FM exposes a Model Context Protocol server so AI agents are first-class clients for forecast-modification management. The MCP layer is a thin adapter over the Ch. 08 API — same engine, same semantics — with tool descriptions written for an agent that has never seen this specification.

MC-01Tool coverage MUST equal API coverage (AP-01 transitively): anything a user can do to forecast modifications, batch and admin, an agent can do. The UI-only master-data browser (S5, D-23) has no MCP counterpart beyond get_master_data reference reads.
MC-02Tools are task-shaped, not endpoint-shaped, where that reduces round trips — but each tool maps to documented API operations with no additional logic.

9.1Tool catalogue

ToolMaps toNotes
list_entriesGET /entriesfilters, pagination, state filter
get_entryGET /entries/{id} (+ /lo optional)flag include_lo_sample returns first N LO rows
create_entryPOST /entriesreturns state + error_message + lo_row_count
update_entryPUT /entries/{id}partial update semantics documented in tool description
delete_entryDELETE /entries/{id}irreversible — description says so
preview_disaggregationPOST /entries/previewdry-run; nothing persisted
redisaggregate_entryPOST /entries/{id}/disaggregate
query_loPOST /lo/querygroup-by + filters → aggregated cells; the reporting workhorse
run_batch / get_batch_statusPOST /batch/run · GET /batch/current|laststatus merges live + last report
get_master_dataGET /masterdata/…hierarchy/attributes, locations, customers, calendar — reference reads for scope construction (read-only, D-23)
regenerate_forecastPOST /admin/regenerate-forecastDE-08; requires explicit confirm:true; sets all entries RequiresDisaggregation
reset_demoPOST /admin/resetrequires explicit confirm:true parameter
get_system_statusGET /admin/statusorientation call; cheap

9.2Design rules for the tool surface

MC-03Each tool description MUST state: what the tool does, units (SU, integers), the entry state model (an agent must understand InError is a data outcome, not a tool failure), and destructive-action warnings.
MC-04Tool errors follow AP-04: validation problems return the structured error; disaggregation failure returns a successful result whose payload shows state: "InError" with the message. Descriptions MUST make this distinction explicit.
MC-05Responses stay context-friendly: lists paginate with small defaults; query_lo returns aggregated cells, never raw base-grain dumps unless explicitly requested with a row cap.
MC-06Write tools return the post-state of the touched object in full, so an agent needs no follow-up read to confirm effect.
MC-07Authentication mirrors AP-02 (configured account credentials at server level); no per-tool auth logic.

9.3Reference agent flows (informative)