Skip to main content
Glama

cast_spell

Cast a class spell on a target task or party member to gain buffs or healing in Habitica.

Instructions

Cast a class spell, optionally on a target task or party member.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spellIdYes
targetIdNo

Implementation Reference

  • Tool definition/schema for 'cast_spell' with inputSchema requiring spellId and optional targetId.
    {
      name: "cast_spell",
      description: "Cast a class spell, optionally on a target task or party member.",
      inputSchema: {
        type: "object",
        properties: {
          spellId: { type: "string" },
          targetId: { type: "string" },
        },
        required: ["spellId"],
      },
    },
  • Handler for cast_spell: calls the Habitica API with spellId (and optional targetId) and returns a success message.
    cast_spell: async ({ spellId, targetId }) => {
      const path = targetId
        ? `/user/class/cast/${spellId}?targetId=${encodeURIComponent(targetId)}`
        : `/user/class/cast/${spellId}`;
      await api("POST", path);
      return ok(`Cast ${spellId}${targetId ? ` on ${targetId}` : ""}.`);
    },
  • index.js:482-492 (registration)
    Registration via CallToolRequestSchema on the MCP Server, routing tool name 'cast_spell' to the handler.
    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 are provided, so the description must disclose behavioral traits. It only states the action ('Cast') without detailing effects, resource consumption, cooldowns, or prerequisites. This is insufficient for an agent to predict the tool's behavior.

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?

The description is a single sentence of 13 words, with no redundant information. Every part is necessary to convey the core purpose and optional target.

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?

Given the complexity of spell casting (e.g., mana, cooldowns, restrictions), the description is too sparse. It lacks details on return values, side effects, or prerequisites. No output schema exists to compensate.

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 description coverage is 0%, so the description needs to elaborate on parameters. It only hints that targetId is optional and for a task or party member, but spellId is completely unexplained. The description adds minimal semantic value beyond the 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?

The description clearly states the action ('Cast') and the resource ('a class spell'), with an optional target specification. It effectively distinguishes itself from sibling tools, which are focused on tasks, items, pets, etc., with no other spell-related tools present.

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?

The description implies the tool is used to cast spells, but provides no explicit guidance on when to use it versus alternatives. Since there are no other spell-casting tools among siblings, the context is clear, but the description lacks when-not-to-use or prerequisite information.

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