ot_buy
Buy supplies at trading posts or forts. Choose from food, medicine, ammo, parts, or oxen at set prices per unit.
Instructions
Buy supplies at a trading post or fort. Only available at stops where trading is possible. Prices: food=$2/day, medicine=$6/dose, ammo=$1/round, parts=$10, oxen=$20.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item | Yes | What to buy | |
| quantity | Yes | How much to buy |
Implementation Reference
- src/games/oregontrail.ts:687-1206 (registration)All Oregon Trail tools are registered inside registerOregonTrailTools(server), including ot_buy.
export function registerOregonTrailTools(server: McpServer): void { server.tool( "ot_new_game", "Begin the journey to the Well at Eldenmoor. Provide the human player's name — Claude names its own character, and a pet is assigned at random. The trail is generated fresh each run — stops, NPCs, and scenery will differ. Read the full intro to the human before asking what they want to do.", { player_name: z.string().describe("The human player's character name"), }, async ({ player_name }) => { const companionName = pick(COMPANION_NAMES); const petDef = pick(PETS); const trailStops = generateTrail(); otGame = { player: { name: player_name, health: 100 }, companion: { name: companionName, health: 100 }, pet: { ...petDef, health: 100, alive: true }, supplies: { food: 28, medicine: 5, ammo: 80, money: 60, parts: 3, oxen: 4 }, trailStops, currentStopIndex: 0, mile: 0, day: 1, weather: pick(WEATHER_OPTIONS), status: "at_stop", pendingRiver: false, eventLog: [], }; const trailList = trailStops.map(s => s.name).join(" → "); return { content: [{ type: "text", text: [ `✨ THE WELL AT ELDENMOOR ✨`, ``, `They say there is a well at the edge of the Greymoor — ancient, unmarked on any`, `map, built by no hands anyone remembers. They say if you find it, you can make a wish.`, `They say the well grants it.`, ``, `They don't always mention the other part.`, ``, `── YOUR PARTY ──────────────────────────────`, ` ${player_name}`, ` That's you. You've heard the stories your whole life.`, ``, ` ${companionName}`, ` A traveling companion of uncertain background. (That's Claude.)`, ` ${companionName} has their own reasons for making this trip.`, ` They haven't shared them yet.`, ``, ` ${petDef.name} — ${petDef.species}`, ` Joined the party uninvited and shows no signs of leaving.`, ` You've decided this is fine.`, ``, `── THE TRAIL ─────────────────────────────────`, ` ${trailList}`, ` 1,200 miles total. The trail shifts each journey — not every road is the same twice.`, ``, `── HOW TO PLAY ───────────────────────────────`, ` ot_travel(pace) hit the trail: "easy", "steady", or "hard"`, ` ot_hunt() stop to hunt for food`, ` ot_rest(days) make camp and recover (1–3 days)`, ` ot_buy(item, qty) restock at trading posts and forts`, ` ot_sell(item, qty) unload surplus at a loss`, ` ot_cross_river(how) ford / caulk / ferry / wait`, ` ot_use_medicine(who) treat player, companion, or pet`, ` ot_status() check state anytime — free`, ` ot_make_wish(wish) only at the Well`, ``, `We make decisions together. You call the shots. I'll tell the story.`, ``, `[Show this full intro to the human verbatim, then present the status`, ` below and ask what pace they'd like to set out at.]`, ``, renderState(otGame), ].join("\n"), }], }; } ); server.tool( "ot_travel", "Hit the trail for 3 days. Always costs food and may affect health — plan supplies before calling. Costs: easy=-6 food, +9hp each; steady=-9 food, 0hp change; hard=-12 food, -21hp each, -12hp pet. Random events add further gains/losses on top. Narrate what happens to the human dramatically.", { pace: z.enum(["easy", "steady", "hard"]).describe("Travel pace — easy (15 mi/day, -6 food, +9hp), steady (22 mi/day, -9 food, no health change), hard (32 mi/day, -12 food, -21hp, -12hp pet)"), }, async ({ pace }) => { if (!otGame) return { content: [{ type: "text", text: "No journey in progress. Call ot_new_game to begin." }], isError: true }; if (otGame.status === "won" || otGame.status === "game_over") return { content: [{ type: "text", text: `The journey is over. Call ot_new_game to start again.` }], isError: true }; if (otGame.pendingRiver) return { content: [{ type: "text", text: `You're at a river. Choose a crossing method with ot_cross_river first.\n\n${renderState(otGame)}` }], isError: true }; const milesPerDay = pace === "easy" ? 15 : pace === "steady" ? 22 : 32; const healthPerDay = pace === "easy" ? 3 : pace === "steady" ? 0 : -7; const foodPerDay = pace === "easy" ? 2 : pace === "steady" ? 3 : 4; const daysOfTravel = 3; const narratives: string[] = []; const foodBefore = otGame.supplies.food; for (let d = 0; d < daysOfTravel; d++) { otGame.day++; otGame.mile = Math.min(TOTAL_MILES, otGame.mile + milesPerDay); otGame.supplies.food = Math.max(0, otGame.supplies.food - foodPerDay); // Starvation if (otGame.supplies.food <= 0) { otGame.player.health = clamp(otGame.player.health - 10, 0, 100); otGame.companion.health = clamp(otGame.companion.health - 10, 0, 100); narratives.push(`No food. Hunger is taking its toll.`); log(otGame, "No provisions. Everyone weakening."); } // Pace health if (healthPerDay !== 0) { otGame.player.health = clamp(otGame.player.health + healthPerDay, 0, 100); otGame.companion.health = clamp(otGame.companion.health + healthPerDay, 0, 100); } // Pets wear down on hard pace too if (pace === "hard" && otGame.pet.alive) { otGame.pet.health = clamp(otGame.pet.health - 4, 0, 100); if (otGame.pet.health <= 0) otGame.pet.alive = false; } // Random event if (Math.random() < 0.65) { const ev = rollEvent(otGame); applyEvent(otGame, ev); narratives.push(ev.text); log(otGame, ev.text.slice(0, 80) + (ev.text.length > 80 ? "…" : "")); } // Weather shift if (Math.random() < 0.25) otGame.weather = pick(WEATHER_OPTIONS); // Check new stop arrival for (let i = otGame.currentStopIndex + 1; i < otGame.trailStops.length; i++) { if (otGame.mile >= otGame.trailStops[i].mile) { otGame.currentStopIndex = i; const stop = otGame.trailStops[i]; narratives.push(`You've reached ${stop.name}.`); log(otGame, `Arrived at ${stop.name}.`); if (stop.type === "destination") { otGame.status = "won"; } else if (stop.type === "river") { otGame.status = "river_crossing"; otGame.pendingRiver = true; } else { otGame.status = "at_stop"; } break; } } // Death check if (otGame.player.health <= 0 && otGame.companion.health <= 0) { otGame.status = "game_over"; narratives.push("Both travelers have fallen. The road claims two more who sought the Well."); break; } if (otGame.status === "won" || (otGame.status as string) === "game_over" || otGame.pendingRiver) break; } if (otGame.status !== "at_stop" && otGame.status !== "river_crossing" && otGame.status !== "won" && otGame.status !== "game_over") { otGame.status = "traveling"; } const travelFoodCost = foodPerDay * daysOfTravel; const netFoodChange = otGame.supplies.food - foodBefore; const eventFoodNet = netFoodChange + travelFoodCost; // positive = events gave food overall const summary = [ `━━ ${daysOfTravel} days on the trail (${pace} pace) ━━`, `Travel cost: -${travelFoodCost} food, +${milesPerDay * daysOfTravel} miles`, eventFoodNet !== 0 ? `Events: ${eventFoodNet > 0 ? "+" : ""}${eventFoodNet} food (net)` : `Events: no net food change`, `Food: ${foodBefore} → ${otGame.supplies.food}`, ].join(" | "); const body = narratives.map((n, i) => `Day ${otGame!.day - (daysOfTravel - 1 - i)}: ${n}`).join("\n\n"); return { content: [{ type: "text", text: `${summary}\n\n${body}\n\n${renderState(otGame)}`, }], }; } ); server.tool( "ot_hunt", "Stop to hunt for food. Takes half a day, uses ammo, and the results are unpredictable. Narrate the hunt to the human.", {}, async () => { if (!otGame) return { content: [{ type: "text", text: "No journey in progress." }], isError: true }; if (otGame.status === "won" || otGame.status === "game_over") return { content: [{ type: "text", text: "The journey is over." }], isError: true }; if (otGame.supplies.ammo <= 0) return { content: [{ type: "text", text: `No ammunition left. Nothing to hunt with.\n\n${renderState(otGame)}` }], isError: true }; otGame.supplies.ammo = Math.max(0, otGame.supplies.ammo - 10); const roll = Math.random(); let text: string; let foodGained = 0; if (roll < 0.15) { text = "Nothing. Half a day and ten rounds spent on shadows. The trail mocks you."; } else if (roll < 0.45) { foodGained = rand(3, 6); text = `A modest haul — enough to stretch provisions a few more days.`; } else if (roll < 0.80) { foodGained = rand(8, 14); text = `A solid hunt. You return to camp before dark with real food. ${otGame.companion.name} looks relieved.`; } else { foodGained = rand(16, 24); text = `An exceptional day. ${otGame.companion.name} looks genuinely impressed. You'll eat well tonight.`; } otGame.supplies.food += foodGained; log(otGame, `Hunting: ${text.slice(0, 60)}… (+${foodGained} days food)`); return { content: [{ type: "text", text: `${text}${foodGained > 0 ? ` (+${foodGained} days of provisions)` : ""}\n\n${renderState(otGame)}`, }], }; } ); server.tool( "ot_rest", "Make camp and rest for 1–3 days. Recovers health for everyone but costs food and time. Worth it when someone is struggling.", { days: z.number().int().min(1).max(3).describe("Days to rest (1–3)"), }, async ({ days }) => { if (!otGame) return { content: [{ type: "text", text: "No journey in progress." }], isError: true }; if (otGame.status === "won" || otGame.status === "game_over") return { content: [{ type: "text", text: "The journey is over." }], isError: true }; otGame.day += days; otGame.supplies.food = Math.max(0, otGame.supplies.food - (days * 2)); otGame.player.health = clamp(otGame.player.health + (days * 18), 0, 100); otGame.companion.health = clamp(otGame.companion.health + (days * 18), 0, 100); if (otGame.pet.alive) otGame.pet.health = clamp(otGame.pet.health + (days * 12), 0, 100); const text = [ `You make camp and rest for ${days} day${days > 1 ? "s" : ""}.`, `${otGame.companion.name} sleeps properly for the first time in a while.`, otGame.pet.alive ? `${otGame.pet.name} seems grateful for the stillness.` : "", `Everyone feels meaningfully better for it.`, ].filter(Boolean).join(" "); log(otGame, `Rested ${days} day${days > 1 ? "s" : ""}. Party recovered.`); return { content: [{ type: "text", text: `${text}\n\n${renderState(otGame)}` }], }; } ); server.tool( "ot_buy", "Buy supplies at a trading post or fort. Only available at stops where trading is possible. Prices: food=$2/day, medicine=$6/dose, ammo=$1/round, parts=$10, oxen=$20.", { item: z.enum(["food", "medicine", "ammo", "parts", "oxen"]).describe("What to buy"), quantity: z.number().int().min(1).describe("How much to buy"), }, async ({ item, quantity }) => { if (!otGame) return { content: [{ type: "text", text: "No journey in progress." }], isError: true }; const stop = otGame.trailStops[otGame.currentStopIndex]; if (!stop.canTrade) return { content: [{ type: "text", text: `No trading available here. Reach a fort or trading post.\n\n${renderState(otGame)}` }], isError: true }; const prices: Record<string, number> = { food: 2, medicine: 6, ammo: 1, parts: 10, oxen: 20 }; const total = prices[item] * quantity; if (otGame.supplies.money < total) return { content: [{ type: "text", text: `Not enough money. ${item} x${quantity} costs $${total}, you have $${otGame.supplies.money}.\n\n${renderState(otGame)}` }], isError: true }; if (item === "oxen" && otGame.supplies.oxen + quantity > 4) return { content: [{ type: "text", text: `Can't lead more than 4 oxen at once.\n\n${renderState(otGame)}` }], isError: true }; otGame.supplies.money -= total; (otGame.supplies as unknown as Record<string, number>)[item] += quantity; return { content: [{ type: "text", text: `Bought ${quantity} ${item} for $${total}.\n\n${renderState(otGame)}` }], }; } ); server.tool( "ot_sell", "Sell surplus supplies at a trading post or fort. You'll take a loss — traders know you're desperate — but cash in hand beats dead weight in the wagon. Only available where trading is possible. Ammo isn't worth selling. Sell prices: food=$1/day (buy $2), medicine=$4/dose (buy $6), parts=$6 (buy $10), oxen=$12 (buy $20). You must keep at least 1 ox.", { item: z.enum(["food", "medicine", "parts", "oxen"]).describe("What to sell"), quantity: z.number().int().min(1).describe("How much to sell"), }, async ({ item, quantity }) => { if (!otGame) return { content: [{ type: "text", text: "No journey in progress." }], isError: true }; const stop = otGame.trailStops[otGame.currentStopIndex]; if (!stop.canTrade) return { content: [{ type: "text", text: `No trading available here. Reach a fort or trading post.\n\n${renderState(otGame)}` }], isError: true }; const sellPrices: Record<string, number> = { food: 1, medicine: 4, parts: 6, oxen: 12 }; const buyPrices: Record<string, number> = { food: 2, medicine: 6, parts: 10, oxen: 20 }; const current = (otGame.supplies as unknown as Record<string, number>)[item] as number; if (item === "oxen" && otGame.supplies.oxen - quantity < 1) { return { content: [{ type: "text", text: `You need at least 1 ox to keep moving. Can't sell that many.\n\n${renderState(otGame)}` }], isError: true }; } if (current < quantity) { return { content: [{ type: "text", text: `You only have ${current} ${item} to sell.\n\n${renderState(otGame)}` }], isError: true }; } const earned = sellPrices[item] * quantity; const loss = (buyPrices[item] - sellPrices[item]) * quantity; otGame.supplies.money += earned; (otGame.supplies as unknown as Record<string, number>)[item] -= quantity; log(otGame, `Sold ${quantity} ${item} for $${earned}.`); return { content: [{ type: "text", text: `Sold ${quantity} ${item} for $${earned}. (Cost $${buyPrices[item] * quantity} to rebuy — a $${loss} loss. Needs must.)\n\n${renderState(otGame)}` }], }; } ); server.tool( "ot_cross_river", "Choose how to cross the current river. Ford=fast but risky. Caulk=float the wagon, medium risk. Ferry=safe but costs $15. Wait=lose 2 days and food but calmer water. Narrate the crossing dramatically.", { method: z.enum(["ford", "caulk", "ferry", "wait"]).describe("Crossing method"), }, async ({ method }) => { if (!otGame) return { content: [{ type: "text", text: "No journey in progress." }], isError: true }; if (!otGame.pendingRiver) return { content: [{ type: "text", text: `You're not at a river crossing.\n\n${renderState(otGame)}` }], isError: true }; const stop = otGame.trailStops[otGame.currentStopIndex]; let text: string; if (method === "ford") { const roll = Math.random(); if (roll < 0.28) { if (Math.random() < 0.4) otGame.supplies.oxen = Math.max(1, otGame.supplies.oxen - 1); if (Math.random() < 0.5) otGame.supplies.parts = Math.max(0, otGame.supplies.parts - 1); otGame.player.health = clamp(otGame.player.health - 22, 0, 100); otGame.companion.health = clamp(otGame.companion.health - 15, 0, 100); otGame.supplies.food = Math.max(0, otGame.supplies.food - 4); if (otGame.pet.alive) { otGame.pet.health = clamp(otGame.pet.health - 30, 0, 100); if (otGame.pet.health <= 0) otGame.pet.alive = false; } text = `The ford goes badly. The current grabs the wagon and for a terrifying moment everything is chaos — water, shouting, supplies spilling downstream. You make it across, but not without cost.`; } else if (roll < 0.55) { otGame.player.health = clamp(otGame.player.health - 8, 0, 100); otGame.supplies.food = Math.max(0, otGame.supplies.food - 1); text = `The ford is rough but survivable. Everyone gets soaked. ${otGame.player.name} takes a knock from a submerged rock. You're across.`; } else { text = `The ford goes better than expected. You pick a good line through the current. Everyone across, mostly dry.`; } } else if (method === "caulk") { // Caulking always costs something — it's a full day of cold, exhausting work. otGame.player.health = clamp(otGame.player.health - 8, 0, 100); otGame.companion.health = clamp(otGame.companion.health - 8, 0, 100); otGame.supplies.food = Math.max(0, otGame.supplies.food - 1); if (Math.random() < 0.22) { // Water got into the wagon — something went wrong mid-float. otGame.supplies.parts = Math.max(0, otGame.supplies.parts - 1); otGame.supplies.food = Math.max(0, otGame.supplies.food - 2); otGame.player.health = clamp(otGame.player.health - 10, 0, 100); if (otGame.pet.alive) { otGame.pet.health = clamp(otGame.pet.health - 15, 0, 100); if (otGame.pet.health <= 0) otGame.pet.alive = false; } text = `The float goes wrong mid-crossing. The wagon lists, water pours in, and for a long terrible minute everything is chaos. You make it across, but the wagon took damage and the supplies got wet. Everyone is shaking.`; } else { text = `You spend the better part of a day sealing the wagon and coaxing it across. The current is stronger than it looked from the bank. Everyone arrives soaked, cold, and exhausted — but across.`; } } else if (method === "ferry") { if (otGame.supplies.money < 15) return { content: [{ type: "text", text: `The ferryman wants $15. You only have $${otGame.supplies.money}. Find another way.\n\n${renderState(otGame)}` }], isError: true }; otGame.supplies.money -= 15; text = `You pay the ferryman $15 and cross without incident. ${otGame.companion.name} watches the water the entire way. "${stop.name} lives up to its reputation," they say quietly.`; } else { otGame.day += 2; otGame.supplies.food = Math.max(0, otGame.supplies.food - 4); text = `You make camp and wait two days for the water to settle. It does, slightly. The crossing is uneventful. The delay stings, but you're across.`; } otGame.pendingRiver = false; otGame.status = "traveling"; log(otGame, `Crossed ${stop.name} by ${method}.`); return { content: [{ type: "text", text: `${text}\n\n${renderState(otGame)}` }], }; } ); server.tool( "ot_use_medicine", "Use one dose of medicine on a party member. Restores significant health. Use it when someone is struggling or worse.", { target: z.enum(["player", "companion", "pet"]).describe("Who to treat: player, companion, or pet"), }, async ({ target }) => { if (!otGame) return { content: [{ type: "text", text: "No journey in progress." }], isError: true }; if (otGame.supplies.medicine <= 0) return { content: [{ type: "text", text: `No medicine left.\n\n${renderState(otGame)}` }], isError: true }; if (target === "pet" && !otGame.pet.alive) return { content: [{ type: "text", text: `${otGame.pet.name} is gone. Medicine won't help now.` }], isError: true }; otGame.supplies.medicine--; let text: string; if (target === "player") { otGame.player.health = clamp(otGame.player.health + 40, 0, 100); text = `${otGame.player.name} takes the medicine. Color returns to their face within the hour.`; } else if (target === "companion") { otGame.companion.health = clamp(otGame.companion.health + 40, 0, 100); text = `${otGame.companion.name} accepts the medicine without argument, which tells you everything about how they were feeling.`; } else { otGame.pet.health = clamp(otGame.pet.health + 35, 0, 100); const pronoun = otGame.pet.pronoun === "he" ? "He" : "She"; text = `You coax ${otGame.pet.name} into taking the medicine. ${pronoun} does not make it easy.`; } log(otGame, `Medicine used on ${target}.`); return { content: [{ type: "text", text: `${text}\n\n${renderState(otGame)}` }], }; } ); server.tool( "ot_status", "Check the current state of the journey — party health, supplies, location, and recent events. Free, no cost.", {}, async () => { if (!otGame) return { content: [{ type: "text", text: "No journey in progress. Call ot_new_game to begin." }] }; return { content: [{ type: "text", text: renderState(otGame) }] }; } ); server.tool( "ot_make_wish", "Make your wish at the Well at Eldenmoor. Only available after reaching the Well. The outcome is uncertain. State your wish clearly. Narrate the ending based on the outcome returned.", { wish: z.string().describe("The wish, stated plainly. Be specific — the Well takes you at your word."), }, async ({ wish }) => { if (!otGame) return { content: [{ type: "text", text: "No journey in progress." }], isError: true }; if (otGame.status !== "won") return { content: [{ type: "text", text: `You haven't reached the Well yet.\n\n${renderState(otGame)}` }], isError: true }; const outcome = Math.random() < 0.5 ? "granted" : "cursed"; const grantedSetups = [ "The water stirs. The air goes very still. Something old and patient turns its attention toward you.", "You lean over and speak the words into the dark. The well listens. The well has always been listening.", "For a moment — nothing. Then the world shifts, just slightly, in the way the world does when something true happens.", ]; const cursedSetups = [ "The water stirs. The air goes cold. Something far below smiles.", "You lean over and speak. The echo comes back wrong — the same words, a different meaning.", "A sound rises from the well — not quite an echo. Something between a laugh and a sigh, ancient and unsurprised.", ]; const setup = pick(outcome === "granted" ? grantedSetups : cursedSetups); return { content: [{ type: "text", text: [ `The Well at Eldenmoor.`, `The water does not reflect the sky.`, ``, setup, ``, `The wish: "${wish}"`, ``, `THE WELL'S ANSWER: ${outcome === "granted" ? "✨ GRANTED" : "💀 CURSED"}`, ``, outcome === "granted" ? [ `[Narrate the wish coming true. Make it feel earned — these two people and their ridiculous pet`, ` walked 1,200 miles for this. Give it weight. Give it beauty. Make it specific to the wish.]`, ].join("") : [ `[Narrate the curse. The Well gives exactly what was asked for — every word honored, the spirit`, ` betrayed. Tie the twist directly to the language of the wish. Make it feel inevitable,`, ` not cruel. The Well doesn't punish. It just listens too carefully.]`, ].join(""), ``, `── JOURNEY'S END ────────────────────────────`, ` ${otGame.player.name.padEnd(22)} ${condition(otGame.player.health)}`, ` ${otGame.companion.name.padEnd(22)} ${condition(otGame.companion.health)}`, ` ${otGame.pet.name.padEnd(22)} ${otGame.pet.alive ? condition(otGame.pet.health) : "did not make it"}`, ` 1,200 miles. ${otGame.day} days. One wish.`, ].join("\n"), }], }; } ); server.tool( "ot_clear_game", "Abandon the current journey and clear all game state. Use this to start fresh — especially useful if a stale game from a previous session is still loaded. After calling this, use ot_new_game to begin a new journey.", {}, async () => { const hadGame = otGame !== null; const summary = hadGame ? `${otGame!.player.name} and ${otGame!.companion.name} were on day ${otGame!.day}, mile ${otGame!.mile} of ${TOTAL_MILES}.` : `No journey was in progress.`; otGame = null; return { content: [{ type: "text", text: `The road goes cold. ${summary}\n\nThe Well at Eldenmoor waits, as it always has. Call ot_new_game to begin again.`, }], }; } ); } - src/games/oregontrail.ts:951-976 (handler)The ot_buy tool handler: validates game state, checks trading availability, calculates price, deducts money, adds quantity, returns result.
server.tool( "ot_buy", "Buy supplies at a trading post or fort. Only available at stops where trading is possible. Prices: food=$2/day, medicine=$6/dose, ammo=$1/round, parts=$10, oxen=$20.", { item: z.enum(["food", "medicine", "ammo", "parts", "oxen"]).describe("What to buy"), quantity: z.number().int().min(1).describe("How much to buy"), }, async ({ item, quantity }) => { if (!otGame) return { content: [{ type: "text", text: "No journey in progress." }], isError: true }; const stop = otGame.trailStops[otGame.currentStopIndex]; if (!stop.canTrade) return { content: [{ type: "text", text: `No trading available here. Reach a fort or trading post.\n\n${renderState(otGame)}` }], isError: true }; const prices: Record<string, number> = { food: 2, medicine: 6, ammo: 1, parts: 10, oxen: 20 }; const total = prices[item] * quantity; if (otGame.supplies.money < total) return { content: [{ type: "text", text: `Not enough money. ${item} x${quantity} costs $${total}, you have $${otGame.supplies.money}.\n\n${renderState(otGame)}` }], isError: true }; if (item === "oxen" && otGame.supplies.oxen + quantity > 4) return { content: [{ type: "text", text: `Can't lead more than 4 oxen at once.\n\n${renderState(otGame)}` }], isError: true }; otGame.supplies.money -= total; (otGame.supplies as unknown as Record<string, number>)[item] += quantity; return { content: [{ type: "text", text: `Bought ${quantity} ${item} for $${total}.\n\n${renderState(otGame)}` }], }; } ); - src/games/oregontrail.ts:954-957 (schema)Input schema for ot_buy: item (enum: food, medicine, ammo, parts, oxen) and quantity (int >= 1).
{ item: z.enum(["food", "medicine", "ammo", "parts", "oxen"]).describe("What to buy"), quantity: z.number().int().min(1).describe("How much to buy"), }, - src/games/oregontrail.ts:660-661 (helper)renderState shows trading hint mentioning ot_buy is available at stops where canTrade is true.
lines.push(`🏪 Trading available — ot_buy to restock | ot_sell to unload surplus (at a loss)`); } - src/index.ts:19-19 (registration)registerOregonTrailTools(server) is called from the main entry point to wire up all ot_* tools.
registerOregonTrailTools(server);