Skip to main content
Glama

w3_coupon_create

Create or claim a coupon using a unique claim code on the MCP IPFS Server, enabling secure and efficient coupon management for storacha.network spaces.

Instructions

Attempts to create/claim a coupon using a claim code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
claimCodeYesThe claim code for the coupon.

Implementation Reference

  • The main execution logic for the w3_coupon_create tool. Validates arguments with the schema, runs the 'w3 coupon create' command using the claimCode, and formats the stdout as a text content response.
    const handleW3CouponCreate: ToolHandler = async (args) => {
      const parsed = Schemas.W3CouponCreateArgsSchema.safeParse(args);
      if (!parsed.success)
        throw new Error(
          `Invalid arguments for w3_coupon_create: ${parsed.error.message}`
        );
      const { claimCode } = parsed.data;
      const { stdout } = await runW3Command(`coupon create ${claimCode}`);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              message: "Attempted to claim coupon.",
              output: stdout.trim(),
            }),
          },
        ],
      };
    };
  • Zod schema for input validation of w3_coupon_create tool arguments. Requires a single 'claimCode' string parameter.
    export const W3CouponCreateArgsSchema = z
      .object({
        claimCode: z.string().describe("The claim code for the coupon."),
      })
      .describe("Attempts to create/claim a coupon using a claim code.");
  • Maps the tool name 'w3_coupon_create' to its handler function in the exported toolHandlers object.
    w3_coupon_create: handleW3CouponCreate,
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Attempts to create/claim,' implying a mutation with potential failure, but doesn't disclose behavioral traits like required permissions, rate limits, idempotency, or what happens on success/failure (e.g., coupon activation). For a mutation tool with zero annotation coverage, this is inadequate, warranting a 2.

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, efficient sentence: 'Attempts to create/claim a coupon using a claim code.' It's front-loaded with the core purpose, has zero wasted words, and appropriately sized for a simple tool. Every word earns its place, making it a 5.

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 tool's complexity (a mutation with no annotations, 1 parameter, and no output schema), the description is incomplete. It lacks details on behavioral aspects (e.g., side effects, error handling) and output expectations, which are crucial for an agent to use it correctly. With no annotations or output schema, the description should do more to compensate, scoring a 2.

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 description coverage is 100%, with the schema documenting the 'claimCode' parameter as 'The claim code for the coupon.' The description adds no additional meaning beyond this, such as format examples or constraints. With high schema coverage, the baseline is 3, as the schema does the heavy lifting.

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?

The description clearly states the tool's purpose: 'Attempts to create/claim a coupon using a claim code.' It specifies the verb ('create/claim') and resource ('coupon'), and distinguishes it from siblings like w3_coupon_* tools (none listed) or w3_plan_get. However, it doesn't explicitly differentiate from non-coupon siblings, keeping it at 4 rather than 5.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a claim code), exclusions, or related tools like w3_can_access_claim (which might check claim validity). Without any usage context, the score is 2.

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

Related 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/alexbakers/mcp-ipfs'

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