Skip to content

feat: add model object export reads#29

Open
AlexanderNZ wants to merge 1 commit intoIcePanel:mainfrom
AlexanderNZ:pr/read-model-object-exports
Open

feat: add model object export reads#29
AlexanderNZ wants to merge 1 commit intoIcePanel:mainfrom
AlexanderNZ:pr/read-model-object-exports

Conversation

@AlexanderNZ
Copy link
Contributor

@AlexanderNZ AlexanderNZ commented Jan 29, 2026

I added the CSV and dependency export reads so model object data can be pulled in bulk.

What I changed

  • added model objects CSV export read
  • added model object dependencies JSON read

Why I did it

  • exports are the fastest way to move model data into other tools
  • dependencies JSON is great for impact checks

Notes

Test plan

  • not run

Note

Medium Risk
Adds a new IcePanel API client with retries/timeouts and introduces MCP tools that can create/update/delete model objects, which increases blast radius if misused or misconfigured. Primary risk is correctness of request/response typing and error handling around external API calls (including destructive deletes).

Overview
Introduces a new src/services/icepanel-client.ts IcePanel API client with validated base URL config, API key enforcement, request timeouts, GET retry/backoff, and a structured IcePanelApiError + handleApiError mapping.

Expands IcePanel surface area beyond basic reads by adding read endpoints (including model object CSV export and model object dependencies JSON export) plus additional resources (connections CSV, tags/tag-groups, domains, diagrams/flows and exports) and write operations for model objects, connections, tags, and domains.

Adds src/tools/model-objects.ts MCP tools for listing/searching model objects, fetching details/connections, exporting CSV and dependency JSON, and performing CRUD (create/update/delete) with zod validation and formatted outputs.

Updates src/types.ts to broaden model object status/type unions and add request/response types for the new endpoints and write operations.

Written by Cursor Bugbot for commit 34c5c74. 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 1 potential issue.

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

const url = `${API_BASE_URL}${path}`;

const headers = {
Accept: "application/json",
Copy link

Choose a reason for hiding this comment

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

Text export uses wrong Accept header for CSV

Medium Severity

The apiRequestText function sets Accept: "application/json" header but is used for endpoints returning non-JSON content (CSV, plain text, mermaid diagrams). This tells the API server the client prefers JSON responses, which could cause content negotiation issues if the server respects the Accept header. The endpoints getModelObjectsCsv, getModelConnectionsCsv, getFlowText, getFlowCode, and getFlowMermaid all rely on this function expecting text/csv or plain text responses.

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