Skip to main content
Glama

buy_reward

Purchase a custom reward using its unique key.

Instructions

Buy a custom reward by key.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes

Implementation Reference

  • index.js:297-305 (registration)
    Tool definition for 'buy_reward' registered in the tools array with name, description, and inputSchema requiring 'key'.
    {
      name: "buy_reward",
      description: "Buy a custom reward by key.",
      inputSchema: {
        type: "object",
        properties: { key: { type: "string" } },
        required: ["key"],
      },
    },
  • Handler function for 'buy_reward' that sends a POST request to /user/buy/{key} and returns the resulting gold balance.
    buy_reward: async ({ key }) => {
      const r = (await api("POST", `/user/buy/${encodeURIComponent(key)}`)).data;
      return ok(`Bought reward "${key}". gp: ${r?.gp ?? "?"}`);
    },
  • index.js:482-492 (registration)
    The CallToolRequestSchema handler that dispatches tool calls (including 'buy_reward') to the handlers map.
    server.setRequestHandler(CallToolRequestSchema, async (req) => {
      const { name, arguments: args = {} } = req.params;
      const fn = handlers[name];
      if (!fn) throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
      try {
        return await fn(args);
      } catch (err) {
        if (err instanceof McpError) throw err;
        throw new McpError(ErrorCode.InternalError, err?.message ?? String(err));
      }
    });
Behavior2/5

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

No annotations provided. Description 'Buy' implies a mutation, but does not disclose side effects (e.g., deduction from user balance, creation of a record), required permissions, or error conditions. Insufficient for safe autonomous invocation.

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

Conciseness4/5

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

Single sentence, 6 words, highly concise. No unnecessary information. However, given the lack of depth, it may be overly terse. Still earns points for efficiency.

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

Completeness2/5

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

No output schema, no annotations, minimal parameter coverage. Description fails to explain what 'custom reward' means, how the key is used, or what the tool returns. Incomplete for an agent to safely and correctly execute the tool.

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

Parameters2/5

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

Schema has one string parameter 'key' with no description (0% coverage). Description mentions 'by key' but does not clarify what the key represents (e.g., reward ID, name, or unique identifier). Falls to add meaningful semantics beyond schema.

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?

Description clearly states the action ('Buy') and resource ('custom reward') with a method ('by key'). Distinguishes from sibling 'buy_item' by specifying 'custom reward', though not explicitly. Adequate for purpose clarity.

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

Usage Guidelines2/5

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

No guidance on when to use this tool vs siblings like 'buy_item' or 'cast_spell'. Lacks context on prerequisites, such as whether user must have sufficient currency or the reward must already be defined.

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/leon-jarvis1/habitca_mcp'

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