Skip to content

feat: add pcm_generate_startlist_xml tool - #8

Merged
mpicciolli merged 4 commits into
mainfrom
feat/generate-startlist-xml
Jun 29, 2026
Merged

feat: add pcm_generate_startlist_xml tool#8
mpicciolli merged 4 commits into
mainfrom
feat/generate-startlist-xml

Conversation

@mpicciolli

@mpicciolli mpicciolli commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

What

Adds a new MCP tool pcm_generate_startlist_xml that 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:

<startlist>
    <team id="34">
        <cyclist id="7602" />
        <cyclist id="5996" />
    </team>
</startlist>

Inputs / outputs

  • Input: savePath, raceId (STA_race.IDrace), and teams ([{ id, cyclists: number[] }]).
  • Output: xml (the document as text) and fileName, derived from STA_race.gene_sz_filename for the given race (e.g. c0_almeria.xml).

To resolve the file name, the tool reads the .cdb save via withSaveDb and looks up the race row — staying within the server's read-only guarantee (the save is never modified). The XML builder (buildStartlistXml) lives in helpers.ts.

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 of gene_sz_filename via withSaveDb and 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.

mpicciolli and others added 3 commits June 29, 2026 08:46
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>
@mpicciolli
mpicciolli merged commit a59fff4 into main Jun 29, 2026
2 checks passed
@mpicciolli
mpicciolli deleted the feat/generate-startlist-xml branch June 29, 2026 13:06
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.

2 participants