Skip to main content
Glama

ot_use_medicine

Administer medicine to restore significant health to a party member. Use when the target is struggling or in critical condition.

Instructions

Use one dose of medicine on a party member. Restores significant health. Use it when someone is struggling or worse.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYesWho to treat: player, companion, or pet

Implementation Reference

  • The actual handler function for the ot_use_medicine tool. It checks for active game and medicine supply, deducts one dose, and restores 40 health for player/companion or 35 health for pet.
    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)}` }],
        };
      }
    );
  • Input schema for ot_use_medicine: requires a 'target' enum of 'player', 'companion', or 'pet'.
    {
      target: z.enum(["player", "companion", "pet"]).describe("Who to treat: player, companion, or pet"),
    },
  • The tool is registered via server.tool('ot_use_medicine', ...) within registerOregonTrailTools, which is called from src/index.ts at line 19.
    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)}` }],
        };
      }
    );
  • The clamp() helper used by the handler to keep health values within 0-100 range.
    function clamp(v: number, lo: number, hi: number): number {
      return Math.max(lo, Math.min(hi, v));
    }
  • The log() helper used to record events in the game state's eventLog.
    function log(state: OtState, entry: string): void {
      state.eventLog.push(`Day ${state.day}: ${entry}`);
      if (state.eventLog.length > 8) state.eventLog.shift();
    }
Behavior3/5

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

Discloses the effect of restoring significant health, implying consumption of medicine. However, without annotations, it could better describe resource usage or restrictions.

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?

Two concise sentences front-loaded with action and effect, followed by usage hint. No extraneous 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 tool with one parameter, description covers purpose, condition, and effect. Could mention inventory consumption, but not critical.

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

Parameters3/5

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

Schema covers target parameter with enum and description. Description adds 'party member' context but does not significantly enhance beyond schema (100% coverage).

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

Purpose4/5

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

Clearly states the tool uses one dose of medicine to restore health on a party member. Specific verb and resource, but does not differentiate from potential healing alternatives like rest.

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

Usage Guidelines3/5

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

Provides a guideline 'when someone is struggling or worse', which gives context for use, but lacks explicit when-not-to-use or alternative tools.

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