feat: add pcm_generate_startlist_xml tool - #8
Merged
Conversation
Add a tool that builds a Pro Cycling Manager startlist XML document from a list of teams and their cyclist rosters. The output file name is derived from STA_race.gene_sz_filename for the given IDrace (e.g. c0_almeria.xml), so the tool reads the .cdb save via withSaveDb to resolve it. The XML builder lives in helpers.ts (buildStartlistXml) and is covered by unit tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new read-only MCP tool, pcm_generate_startlist_xml, to generate Pro Cycling Manager startlist XML from provided teams/rosters while deriving the suggested output file name from the save’s STA_race.gene_sz_filename.
Changes:
- Introduces
pcm_generate_startlist_xml, including DB lookup ofgene_sz_filenameviawithSaveDband XML generation via a shared helper. - Adds unit tests for XML formatting/validation (
buildStartlistXml) and filename extension handling (resolveStartlistFileName). - Updates tool registration and documentation tables to include the new tool.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/generate-startlist-xml.test.ts | Adds tests covering XML output formatting, validation errors, and filename extension behavior. |
| src/tools/index.ts | Registers the new pcm_generate_startlist_xml tool with the MCP server. |
| src/tools/generate-startlist-xml.ts | Implements the tool: resolves race startlist filename from STA_race, and generates XML output. |
| src/helpers.ts | Adds buildStartlistXml helper and StartlistTeam interface alongside existing response helpers. |
| README.md | Documents the new tool in the public tool table. |
| AGENTS.md | Updates repository guidance/tool tables to include the new tool and helper mention. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add a project skill that orchestrates the read-only PCM MCP tools to compose a race startlist (find the race, choose teams, pick riders per profile) and delegates serialization to the pcm_generate_startlist_xml tool. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…erate-startlist-xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new MCP tool
pcm_generate_startlist_xmlthat builds a Pro Cycling Manager startlist XML document from a list of teams and their cyclist rosters.The XML format mirrors PCM's expected layout:
Inputs / outputs
savePath,raceId(STA_race.IDrace), andteams([{ id, cyclists: number[] }]).xml(the document as text) andfileName, derived fromSTA_race.gene_sz_filenamefor the given race (e.g.c0_almeria.xml).To resolve the file name, the tool reads the
.cdbsave viawithSaveDband looks up the race row — staying within the server's read-only guarantee (the save is never modified). The XML builder (buildStartlistXml) lives inhelpers.ts.