Skip to content

feat: add flow reads#28

Open
AlexanderNZ wants to merge 1 commit intoIcePanel:mainfrom
AlexanderNZ:pr/read-flows
Open

feat: add flow reads#28
AlexanderNZ wants to merge 1 commit intoIcePanel:mainfrom
AlexanderNZ:pr/read-flows

Conversation

@AlexanderNZ
Copy link
Contributor

@AlexanderNZ AlexanderNZ commented Jan 29, 2026

I wired up flow reads, including text/code/Mermaid exports, so MCP can pull flow data cleanly.

What I changed

  • added list/get flow reads
  • added flow thumbnail reads
  • added text/code/Mermaid export reads

Why I did it

  • flows are core to how we describe architecture behavior
  • the export formats are handy for docs and automation

Notes

Test plan

  • not run

Note

Medium Risk
Adds new API client surface area and multiple MCP tools that call external IcePanel endpoints (including export endpoints), plus retry/timeout/env validation logic that could affect runtime behavior if misconfigured.

Overview
Adds a new icepanel-client service that centralizes IcePanel API calls with configurable base URL, timeouts, and retry/backoff, plus structured IcePanelApiError handling and filter-to-query serialization.

Introduces new MCP tools for flow reads: icepanel_list_flows (with optional fuzzy search), icepanel_get_flow, icepanel_list_flow_thumbnails, icepanel_get_flow_thumbnail, and flow export readers for text/code/Mermaid, and wires them into registerAllTools.

Extends src/types.ts with flow/diagram/tag/domain request/response shapes (and broadens ModelObject unions) to support the new endpoints.

Written by Cursor Bugbot for commit 1d3e6cf. This will update automatically on new commits. Configure here.

Recommended merge order

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

const headers = {
Accept: "application/json",
"Content-Type": "application/json",
Authorization: `ApiKey ${getApiKey()}`,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect Accept header for text export requests

Low Severity

The apiRequestText function sets Accept: "application/json" but is specifically used for text export endpoints (/export/text, /export/code, /export/mermaid). Requesting JSON content type when expecting plain text responses is semantically incorrect and could cause issues if the API strictly validates Accept headers.

Fix in Cursor Fix in Web

}

throw new Error("Unexpected error in apiRequestText");
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated API request functions with identical retry logic

Medium Severity

The apiRequest and apiRequestText functions contain nearly identical implementations spanning ~70 lines each. Both share the same URL construction, header setup, retry loop, AbortController management, and error handling. The only difference is that one returns response.json() and the other returns response.text(). This duplication means any bug fix or enhancement to retry/timeout logic must be manually replicated in both places, increasing maintenance burden and risk of inconsistencies.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant