Run a catalog operation
Wraps the server's invoke_datasource_api_tool — the only data-egress
tool. Full spec: docs/mcp-tool-spec.md §3.4. For open-ended questions
("how did July look?"), prefer /mosofin:query-workspace.
Steps
- Confirm workspace (
list_workspaces) and, when several company files are connected, the company bydisplay_name(get_agent_datasources) if not already confirmed in this chat. - Verify the requested
tool_nameexists in the live catalog (get_datasource_tools) when unsure — onUNKNOWN_TOOL, pick from the valid-names list; never guess. - Build
params:- Period reports and searches: concrete
start_date+end_date(YYYY-MM-DD) — resolve relative phrases first; ask if ambiguous. - As-of reports: optional
report_date(default today). - Get-by-id:
id.
- Period reports and searches: concrete
- Invoke with
datasource,tool_name,params,workspace_id, anddata_source_id(both on every call and retry — the server is stateless). Independent invokes may batch in parallel. - Handle results and errors:
Unknown tool/ MosoFin tools missing → never say "refresh/reconnect". Give ChatGPT/Codex setup: Settings → Apps & Connectors → create MosoFin athttps://mcp.mosofin.com/mcpwith OAuth → sign in → new chat with MosoFin on. No data.pagination.has_more→ re-invoke withparams.offset = pagination.next_offset.approval_required→ ask the user, retry the same invoke withapproved=true. Never pre-set it.entity_required→ ask which company fromentities[]; retry.datasource_not_active→ give the userreconnect_url; no data.invalid_params→ fix the named field; retry.tool_policy_disabled→ explain; do not retry.
- Check
mock(live vs fixture) and end with a Data sources line (datasource + tool +fetched_atfromprovenance). Never fabricate figures on failure.