Skip to main content
Glama
matthewdtowles

iwantmymtg-mcp

remove_inventory

Removes a specific card and finish combination from your MTG inventory using the authenticated user's API key.

Instructions

Remove a card+finish row from the authenticated user's inventory. Requires IWMM_API_KEY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cardIdYes
isFoilYes

Implementation Reference

  • The handler for the remove_inventory tool. Sends a DELETE request to /api/v1/inventory with cardId and isFoil in the body. Authenticated via API key.
    export const removeInventoryTool = {
      name: "remove_inventory",
      description: "Remove a card+finish row from the authenticated user's inventory. Requires IWMM_API_KEY.",
      inputSchema: z.object({
        cardId: z.string().uuid(),
        isFoil: z.boolean(),
      }),
      handler: (input: { cardId: string; isFoil: boolean }) =>
        apiFetch({ path: "/api/v1/inventory", method: "DELETE", body: input, authenticated: true }),
    };
  • Input schema for remove_inventory: requires cardId (UUID string) and isFoil (boolean).
    inputSchema: z.object({
      cardId: z.string().uuid(),
      isFoil: z.boolean(),
    }),
  • Tool registered in the tools array (line 63) and also available via toolsByName map (lines 90-92).
    removeInventoryTool,
  • Import of removeInventoryTool from inventory.ts module.
      removeInventoryTool,
      getInventoryQuantitiesTool,
    } from "./inventory.js";
  • The apiFetch helper used by the handler to make HTTP requests to the IWMM API. Automatically adds Authorization header when authenticated=true.
    export async function apiFetch<T = unknown>(req: ApiRequest): Promise<T> {
      const url = new URL(req.path, config.baseUrl);
      if (req.query) {
        for (const [k, v] of Object.entries(req.query)) {
          if (v !== undefined && v !== null && v !== "") {
            url.searchParams.set(k, String(v));
          }
        }
      }
    
      const headers: Record<string, string> = {
        Accept: "application/json",
        "User-Agent": "iwantmymtg-mcp/0.0.1",
      };
    
      if (req.authenticated) {
        const { requireApiKey } = await import("./config.js");
        headers["Authorization"] = `Bearer ${requireApiKey()}`;
      }
    
      if (req.body !== undefined) {
        headers["Content-Type"] = "application/json";
      }
    
      const res = await fetch(url, {
        method: req.method ?? "GET",
        headers,
        body: req.body !== undefined ? JSON.stringify(req.body) : undefined,
      });
    
      if (!res.ok) {
        const text = await res.text();
        throw new ApiError(res.status, text, {
          limit: res.headers.get("X-RateLimit-Limit") ?? undefined,
          remaining: res.headers.get("X-RateLimit-Remaining") ?? undefined,
          reset: res.headers.get("X-RateLimit-Reset") ?? undefined,
        });
      }
    
      if (res.status === 204) return undefined as T;
      return (await res.json()) as T;
    }
Behavior3/5

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

Indicates destructive action (remove) and a prerequisite, but lacks details on consequences (e.g., irreversibility, cascading effects) or what happens to associated data. With no annotations, the description carries full burden, yet it provides only basic info.

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?

Single sentence front-loading the core action and requirement. No extraneous words, perfectly concise.

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

Completeness3/5

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

Adequate for a simple deletion tool but missing expected details about return values or success/failure indicators. With no output schema, some guidance on response would improve completeness.

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?

The term 'card+finish row' hints at the role of 'isFoil', but the description does not explain how 'cardId' or 'isFoil' are interpreted operationally. With 0% schema coverage, the description fails to compensate meaningfully.

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?

Clearly states the action (remove) and the specific resource (a card+finish row from the authenticated user's inventory). Differentiates from sibling tools like 'add_inventory' or 'update_inventory' by specifying removal.

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?

Provides an authorization requirement (IWMM_API_KEY) but no guidance on when to use this tool versus alternatives like 'delete_transaction' or 'update_inventory'. Missing context for selective usage.

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/matthewdtowles/iwantmymtg-mcp'

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