Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 14 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ A `.cdb` file is a database, in Cyanide's own binary format. Your **saves** are

That is why one tool speaks of saves and the rest speak of databases:

- **`pcm_list_saves`** finds *your* saves, across every PCM edition installed on the machine.
- **`pcm_list_saves`** finds _your_ saves, across every PCM edition installed on the machine.
- **Every other tool** takes a `databasePath`, the path to any `.cdb`, whether it came from `pcm_list_saves` or from somewhere else entirely.

## Features
Expand Down Expand Up @@ -92,20 +92,20 @@ Auto-discovery via `pcm_list_saves` is therefore **Windows only**. On macOS/Linu

All tools are prefixed with `pcm_`, and every one except `pcm_list_saves` takes an absolute `databasePath`. Every tool except `pcm_update_database` and `pcm_update_cyclist_ratings` is read-only, so clients like Claude Desktop can approve them automatically without a confirmation prompt. The two write tools never overwrite the source or any existing file; they can only create a new `.cdb`.

| Tool | Description |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **pcm_list_saves** | Discover your PCM saves on this machine by scanning the `Pro Cycling Manager <year>/Cloud` folders under `%APPDATA%`, across every installed edition (Windows only). Returns each save's absolute path (pass it as `databasePath` to the other tools), plus file name, last modified date and size (newest first). |
| **pcm_validate_database** | Validate that an absolute path points to an existing `.cdb` database and return its metadata. Stateless: keep the returned path in conversation context to pass to later tools. |
| **pcm_list_tables** | List every table inside a `.cdb` database, with its ID and name, plus the total table count. |
| **pcm_get_table_schema** | Inspect a single table by name. Returns its columns (name, SQL type, NOT NULL and primary key flags) and its row count. Use `pcm_list_tables` first to discover available table names. |
| **pcm_get_player_info** | Get the active human player and their team. Returns the player login plus team details (name, resolved division name, resolved country name, evaluation and manager). |
| **pcm_search_cyclist** | Search for a cyclist by first name and/or last name (case-insensitive partial match). Returns up to 10 matches with all ratings (plain, mountain, medium mountain, downhilling, cobble, time trial, prologue, sprint, acceleration, endurance, resistance, recuperation, hill, baroudeur, current ability) and the resolved country name; a `truncated` flag signals when more matches exist. `mediumMountain` and `currentAbility` are `null` on databases that pre-date those columns. |
| **pcm_get_team_roster** | List a team's roster (defaults to the active player's team when `teamId` is omitted). Joins DYN_cyclist with its active DYN_contract_cyclist and STA_type_rider; per rider returns name, country, age (derived from birth date and the current game date), rider type, overall ability, contract end year, wage, market value and all per-terrain ability ratings. Ordered by overall ability, highest first. Errors if `teamId` does not exist. |
| **pcm_search_team** | Search for a team by name (case-insensitive partial match against both the full name and short name). Returns up to 10 matches with the resolved division name, country name, evaluation and general manager; a `truncated` flag signals when more matches exist. |
| **pcm_query_database** | Run a read-only SQL query (`SELECT` / `WITH … SELECT` only) against any table. Write/DDL statements are rejected. Results are capped (default 100, max 1000 rows). |
| **pcm_update_database** | Apply a single `INSERT`/`UPDATE`/`DELETE` statement and write the modified database to a **new** `.cdb` at `outputPath`. The source is never overwritten (`outputPath` must differ from `databasePath`); `SELECT`, schema changes (`DROP`/`CREATE`/`ALTER`) and stacked statements are rejected. Returns the written path and the number of rows changed. |
| Tool | Description |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **pcm_list_saves** | Discover your PCM saves on this machine by scanning the `Pro Cycling Manager <year>/Cloud` folders under `%APPDATA%`, across every installed edition (Windows only). Returns each save's absolute path (pass it as `databasePath` to the other tools), plus file name, last modified date and size (newest first). |
| **pcm_validate_database** | Validate that an absolute path points to an existing `.cdb` database and return its metadata. Stateless: keep the returned path in conversation context to pass to later tools. |
| **pcm_list_tables** | List every table inside a `.cdb` database, with its ID and name, plus the total table count. |
| **pcm_get_table_schema** | Inspect a single table by name. Returns its columns (name, SQL type, NOT NULL and primary key flags) and its row count. Use `pcm_list_tables` first to discover available table names. |
| **pcm_get_player_info** | Get the active human player and their team. Returns the player login plus team details (name, resolved division name, resolved country name, evaluation and manager). |
| **pcm_search_cyclist** | Search for a cyclist by first name and/or last name (case-insensitive partial match). Returns up to 10 matches with all ratings (plain, mountain, medium mountain, downhilling, cobble, time trial, prologue, sprint, acceleration, endurance, resistance, recuperation, hill, baroudeur, current ability) and the resolved country name; a `truncated` flag signals when more matches exist. `mediumMountain` and `currentAbility` are `null` on databases that pre-date those columns. |
| **pcm_get_team_roster** | List a team's roster (defaults to the active player's team when `teamId` is omitted). Joins DYN_cyclist with its active DYN_contract_cyclist and STA_type_rider; per rider returns name, country, age (derived from birth date and the current game date), rider type, overall ability, contract end year, wage, market value and all per-terrain ability ratings. Ordered by overall ability, highest first. Errors if `teamId` does not exist. |
| **pcm_search_team** | Search for a team by name (case-insensitive partial match against both the full name and short name). Returns up to 10 matches with the resolved division name, country name, evaluation and general manager; a `truncated` flag signals when more matches exist. |
| **pcm_query_database** | Run a read-only SQL query (`SELECT` / `WITH … SELECT` only) against any table. Write/DDL statements are rejected. Results are capped (default 100, max 1000 rows). |
| **pcm_update_database** | Apply a single `INSERT`/`UPDATE`/`DELETE` statement and write the modified database to a **new** `.cdb` at `outputPath`. The source is never overwritten (`outputPath` must differ from `databasePath`); `SELECT`, schema changes (`DROP`/`CREATE`/`ALTER`) and stacked statements are rejected. Returns the written path and the number of rows changed. |
| **pcm_update_cyclist_ratings** | Change one or more ability ratings of a cyclist (by `IDcyclist`) and write the modified database to a **new** `.cdb` at `outputPath`. Takes a `ratings` object where each field is optional (`plain`, `mountain`, `mediumMountain`, `downhilling`, `cobble`, `timeTrial`, `prologue`, `sprint`, `acceleration`, `endurance`, `resistance`, `recuperation`, `hill`, `baroudeur`; 50–85); only the fields provided are changed. Returns the written path and the cyclist's full ratings after the update. Setting `mediumMountain` is rejected on databases that pre-date that column. |
| **pcm_generate_startlist_xml** | Generate a PCM startlist XML document from a list of teams and their cyclist rosters. Looks up the race by `IDrace` to derive the output file name from `STA_race.gene_sz_filename` (e.g. `c0_almeria.xml`), and returns both the file name and the XML as text. Team and cyclist IDs map to `DYN_team.IDteam` / `DYN_cyclist.IDcyclist` (look them up with `pcm_search_cyclist` or `pcm_query_database`). |
| **pcm_generate_startlist_xml** | Generate a PCM startlist XML document from a list of teams and their cyclist rosters. Looks up the race by `IDrace` to derive the output file name from `STA_race.gene_sz_filename` (e.g. `c0_almeria.xml`), and returns both the file name and the XML as text. Team and cyclist IDs map to `DYN_team.IDteam` / `DYN_cyclist.IDcyclist` (look them up with `pcm_search_cyclist` or `pcm_query_database`). |

## How it works

Expand All @@ -115,20 +115,6 @@ Tools are **stateless**: there is no "current database" held by the server. Ever
2. `pcm_search_cyclist`, `pcm_get_team_roster`, `pcm_query_database`, … to explore it.
3. `pcm_generate_startlist_xml` to produce a startlist file for a race, or `pcm_update_cyclist_ratings` / `pcm_update_database` to write an edited copy.

## Renamed tools

Several tools and the parameter they all take were renamed, so that "save" now means only what the game itself saved and everything else says "database". MCP clients read the tool list at connect time, so **no configuration change is needed**: restart your client and it picks up the new names. Only hand-written prompts, scripts or skills that name a tool or `savePath` explicitly need updating:

| Before | After |
| --------------------- | ------------------------- |
| `savePath` (all tools) | `databasePath` |
| `pcm_validate_save` | `pcm_validate_database` |
| `pcm_get_save_schema` | `pcm_list_tables` |
| `pcm_query_save` | `pcm_query_database` |
| `pcm_update_save` | `pcm_update_database` |

`pcm_list_saves` keeps its name: it is the one tool genuinely about your saves. All other tools are unchanged.

## Development

Clone the repo and install dependencies with `npm install`, then:
Expand Down
Loading