Skip to content

feat: add connection reads#26

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

feat: add connection reads#26
AlexanderNZ wants to merge 1 commit intoIcePanel:mainfrom
AlexanderNZ:pr/read-connections

Conversation

@AlexanderNZ
Copy link
Contributor

@AlexanderNZ AlexanderNZ commented Jan 29, 2026

I filled the read-side gap for connections and added the CSV export while I was there.

What I changed

  • added list/get connection reads
  • added the model connections CSV export read
  • added formatting for connection output

Why I did it

  • without connection reads, the relationship data is hard to use in MCP
  • CSV export is useful for quick audits and spreadsheets

Notes

Test plan

  • not run

Note

Medium Risk
Adds new API client surface area and new MCP tools that can create/update/delete connections, so incorrect IDs/filters or API behavior could lead to unintended changes or noisy retries/timeouts.

Overview
Adds a new icepanel-client service with a fetch wrapper (timeout, retry/backoff, base URL validation) plus typed helpers for querying/filtering IcePanel resources, including model connection list/get and CSV export endpoints.

Introduces new MCP tools in tools/connections.ts to list/get connections, optionally fuzzy-search and paginate results, export connections as CSV, and perform connection CRUD with consistent markdown/JSON formatting and API error messaging.

Written by Cursor Bugbot for commit aaff924. 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 3 potential issues.

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.

CSV request sends incorrect Accept header

Medium Severity

The apiRequestText function sets Accept: "application/json" but is exclusively used for fetching CSV exports via getModelConnectionsCsv. This header tells the server the client wants JSON, not CSV. If the API server respects content negotiation, it may return JSON instead of CSV or return an error.

Fix in Cursor Fix in Web

landscapeId: string,
versionId: string,
connectionId: string
): Promise<ModelConnectionResponse> {
Copy link

Choose a reason for hiding this comment

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

getConnection has inconsistent signature lacking default versionId

Medium Severity

The getConnection function has an inconsistent API design compared to similar functions. It requires versionId as a mandatory second parameter without a default, while getModelObject, getModelConnections, and getModelConnectionsCsv all have versionId with a "latest" default. Additionally, getConnection places versionId before connectionId, whereas getModelObject places the object ID before versionId.

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 retry logic in apiRequest and apiRequestText

Low Severity

The apiRequest and apiRequestText functions contain nearly identical implementations (~70 lines each) with duplicated retry logic, timeout handling, abort signal management, and error handling. The only meaningful difference is the response parsing (JSON vs text). This duplication increases maintenance burden and risks inconsistent bug fixes.

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