Skip to main content
Glama
matthewdtowles

iwantmymtg-mcp

list_transactions

List your paginated transactions with sorting and filtering by type. Free accounts see the last 30 days; premium accounts access full history.

Instructions

List the authenticated user's transactions, paginated. Supports sort/filter query params. Free tier sees the last 30 days only; Premium gets full history. Requires IWMM_API_KEY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNo
limitNo
sortNoSort key (e.g. TX_DATE, TX_TYPE, TX_CARD, TX_PRICE).
orderNo
typeNo

Implementation Reference

  • The full tool definition for 'list_transactions' including its input schema and handler. The handler performs an authenticated GET request to /api/v1/transactions, passing optional pagination/sort/filter query parameters.
    export const listTransactionsTool = {
      name: "list_transactions",
      description:
        "List the authenticated user's transactions, paginated. Supports sort/filter query params. Free tier sees the last 30 days only; Premium gets full history. Requires IWMM_API_KEY.",
      inputSchema: z.object({
        page: z.number().int().min(1).optional(),
        limit: z.number().int().min(1).max(100).optional(),
        sort: z.string().optional().describe("Sort key (e.g. TX_DATE, TX_TYPE, TX_CARD, TX_PRICE)."),
        order: z.enum(["asc", "desc"]).optional(),
        type: z.enum(["BUY", "SELL"]).optional(),
      }),
      handler: (input: Record<string, unknown>) =>
        apiFetch({
          path: "/api/v1/transactions",
          query: input as Record<string, string | number | undefined>,
          authenticated: true,
        }),
    };
  • The Zod input schema for list_transactions: optional page, limit, sort field, sort order, and transaction type filter (BUY/SELL).
    inputSchema: z.object({
      page: z.number().int().min(1).optional(),
      limit: z.number().int().min(1).max(100).optional(),
      sort: z.string().optional().describe("Sort key (e.g. TX_DATE, TX_TYPE, TX_CARD, TX_PRICE)."),
      order: z.enum(["asc", "desc"]).optional(),
      type: z.enum(["BUY", "SELL"]).optional(),
    }),
  • listTransactionsTool is included in the tools array exported from src/tools/index.ts, registering it as an available MCP tool.
    listTransactionsTool,
  • toolsByName maps the string 'list_transactions' to the listTransactionsTool object for runtime lookup when the tool is invoked.
    export const toolsByName: Record<string, ToolDefinition> = Object.fromEntries(
      tools.map((t) => [t.name, t]),
    );
  • The apiFetch helper function used by the handler to execute the HTTP request. It constructs the URL with query params, attaches the Bearer auth token if authenticated=true, and returns parsed JSON.
    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;
    }
Behavior4/5

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

Discloses pagination, sort/filter support, tier-based data access, and authentication requirement. No annotations present, so description carries the load; it covers key behaviors without contradiction.

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?

Three concise sentences, front-loaded with the core purpose, no fluff. Efficiently communicates essential information.

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?

No output schema is provided, and the description omits details about the return format (e.g., pagination metadata). Adequate for basic usage but incomplete for full understanding.

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 only 20%; description merely says 'supports sort/filter query params' without explaining each parameter's meaning, defaults, or constraints. Does not compensate for low schema coverage.

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 tool lists the authenticated user's transactions with pagination, and among siblings it's distinct as the only transaction listing tool.

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 usage context about free vs premium tier limitations and required API key, but does not mention when to use this tool versus alternatives like get_cash_flow or get_portfolio_history.

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