Skip to main content
Glama

ot_sell

Sell surplus supplies at a trading post or fort. Accept a loss on price to get cash and lighten your wagon load.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemYesWhat to sell
quantityYesHow much to sell

Implementation Reference

  • The ot_sell tool handler — sells surplus supplies at trading posts/forts. Validates game state, checks trade availability, enforces minimum 1 ox constraint, calculates sell price (at a loss vs buy price), updates supplies and money, logs the transaction, and returns the updated game state.
    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)}` }],
        };
      }
    );
  • Input schema for ot_sell — validates 'item' (food/medicine/parts/oxen) and 'quantity' (positive integer).
    {
      item:     z.enum(["food", "medicine", "parts", "oxen"]).describe("What to sell"),
      quantity: z.number().int().min(1).describe("How much to sell"),
    },
  • The server.tool() call that registers the 'ot_sell' tool with the MCP server, including its description and Zod schema.
    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 }) => {
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations, but description discloses loss, pricing, and constraints. Doesn't detail error handling or side effects beyond implied inventory removal, but sufficient for safe invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four sentences, each essential: purpose, loss warning, availability, pricing, constraint. Front-loaded with action and location, no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple two-param tool with no output schema and no annotations, the description covers purpose, usage, pricing, and key constraints. Lacks error cases but adequate for typical use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers 100% of parameters. Description adds sell price details and the ox-keeping constraint, which enriches the enum options and quantity boundary beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clear verb 'sell' with specific resource 'surplus supplies' and location 'trading post or fort'. Distinguishes from sibling ot_buy by stating you take a loss.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Specifies where available ('only where trading is possible'), explicit exclusion ('ammo isn't worth selling'), and a constraint ('keep at least 1 ox'). Provides sell prices but lacks explicit alternative tool guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SrmTech-git/MCPArcade'

If you have feedback or need assistance with the MCP directory API, please join our Discord server