galaxyproject / galaxyproject/loom
Orbit/Galaxy MCP: every pages tool builds a doubled `/api/api/pages` URL and 404s
- Dominant language
- TypeScript
- Stars
- 14
- Forks
- 12
- Avg merge
- 6d 5h
- Merged PRs (30d)
- 17
Description
A tester asked Orbit to create a Galaxy notebook for a history. `galaxy_create_page` failed:
```
Error calling tool 'create_page': Create page failed: Unexpected HTTP status code: 404:
No route for /api/api/pages
```
The agent worked around it with a raw `curl` POST to `/api/pages`, which succeeded -- then `galaxy_get_page` failed the same way:
```
404 Client Error: Not Found for url: https:///api/api/pages/
```
**Cause.** bioblend's `GalaxyInstance.url` already ends in `/api` (`galaxyclient.py`: `self.url = f"{self.base_url}/api"`). Every pages tool in `mcp-server-galaxy-py/src/galaxy_mcp/server.py` builds `f"{gi.url}/api/pages..."`, producing `/api/api/pages`.
All seven pages tools are affected -- `list_pages`, `get_page`, `create_page`, `update_page`, `list_page_revisions`, `get_page_revision`, `revert_page_revision`. The Galaxy Pages/notebook surface is entirely non-functional through MCP.
**Regression.** Introduced by the commit that routed the pages tools through bioblend's thread-safe `make_*` helpers. The previous code used a separate base URL that did **not** include `/api` (`f"{base_url}api/pages"`); the switch to `gi.url` kept the `/api` in the path without dropping it from the base.
**Test gap.** `tests/test_page_operations.py` does assert the URLs, but its fixture sets `self.gi.url = "http://localhost:8080"` -- no `/api` suffix, unlike a real `GalaxyInstance`. So all seven assertions pass against a shape that can't occur in production. The fixture should mirror bioblend and use `/api`.
**Same bug, two more call sites.** Two non-pages calls use the identical `f"{gi.url}/api/..."` pattern and both swallow the failure instead of surfacing it:
- the datatypes class mapping (`/api/api/datatypes/types_and_mapping`) -- falls back to an empty mapping on non-200
- the `style=run` workflow download (`/api/api/workflows//download`) -- caught and falls through to a fallback path
These degrade silently rather than erroring, so they're worth fixing in the same pass.
**Not a bug: the markdown/HTML part of the report.** The reporter also noted the page came out as HTML rather than markdown. That's a consequence of the `curl` workaround, not of the tool -- `create_page` already sends `content_format: "markdown"` explicitly. Galaxy's REST default is `html`, so the hand-rolled POST got HTML. No fix needed once the tool itself works.
**Note on repo.** The fix lands in `galaxyproject/galaxy-mcp`, not here; filing in this repo to match how the other `Orbit/Galaxy MCP:` reports are tracked.
**Environment.** Orbit 0.5.1, macOS arm64, Galaxy configured against a public server.
Contributor guide
No contributing guide indexed for this repository
Research direction
Work in galaxyproject/galaxy-mcp, starting with mcp-server-galaxy-py/src/galaxy_mcp/server.py and tests/test_page_operations.py. First compare the real bioblend GalaxyInstance.url, which ends in /api, with the fixture and every f"{gi.url}/api/..." call site. Done means the seven pages tools and the datatypes and workflow paths no longer produce /api/api URLs, with tests covering the real URL shape.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 70/100