Skip to main content
Glama

w3_login

Initiate login authentication via email for accessing the MCP IPFS server. Users must confirm their email to complete authorization and proceed with server tools.

Instructions

Initiates the w3 login process using the pre-configured email (W3_LOGIN_EMAIL env var). IMPORTANT: The command expects email confirmation, so before running the w3_login tool, emphasize ATTENTION to the user in large letters + emoji that they MUST check email to complete authentication. If the final output includes 'Agent was authorized by', the user has already clicked the link and is successfully authorized, CONTINUE using mcp-ipfs tools. 'Too Many Requests': wait a moment before requesting it again.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that implements the core logic of the w3_login tool. It retrieves the email from the W3_LOGIN_EMAIL environment variable, logs the initiation, executes the w3 CLI 'login' command, and returns the stdout/stderr output wrapped in a JSON message.
    const handleW3Login: ToolHandler = async (_args) => {
      const loginEmail = process.env["W3_LOGIN_EMAIL"]; // Checked at startup
      logger.info(
        `Initiating login for ${loginEmail}. User MUST check email to authorize.`
      );
      const { stdout, stderr } = await runW3Command(`login ${loginEmail!}`);
      const output = `Login process initiated for ${loginEmail!}. Output from w3:\nStdout: ${stdout}\nStderr: ${stderr}\nPlease check your email to complete the login.`;
      return {
        content: [{ type: "text", text: JSON.stringify({ message: output }) }],
      };
    };
  • Zod schema defining the input arguments for the w3_login tool (empty object since no arguments are required) along with a descriptive string explaining usage and prerequisites.
    export const W3LoginArgsSchema = z
      .object({})
      .describe(
        "Initiates the w3 login process using the pre-configured email (W3_LOGIN_EMAIL env var). Highlight to the user that they MUST check email to complete authentication."
      );
  • The toolHandlers object maps the string 'w3_login' to its handler function handleW3Login. This map is imported and used in src/index.ts to dispatch CallTool requests to the correct handler based on the tool name.
    export const toolHandlers: Record<string, ToolHandler> = {
      w3_login: handleW3Login,
      w3_space_ls: handleW3SpaceLs,
      w3_space_use: handleW3SpaceUse,
      w3_space_create: handleW3SpaceCreate,
      w3_up: handleW3Up,
      w3_ls: handleW3Ls,
      w3_rm: handleW3Rm,
      w3_open: handleW3Open,
      w3_space_info: handleW3SpaceInfo,
      w3_space_add: handleW3SpaceAdd,
      w3_delegation_create: handleW3DelegationCreate,
      w3_delegation_ls: handleW3DelegationLs,
      w3_delegation_revoke: handleW3DelegationRevoke,
      w3_proof_add: handleW3ProofAdd,
      w3_proof_ls: handleW3ProofLs,
      w3_key_create: handleW3KeyCreate,
      w3_bridge_generate_tokens: handleW3BridgeGenerateTokens,
      w3_can_blob_add: handleW3CanBlobAdd,
      w3_can_blob_ls: handleW3CanBlobLs,
      w3_can_blob_rm: handleW3CanBlobRm,
      w3_can_index_add: handleW3CanIndexAdd,
      w3_can_upload_add: handleW3CanUploadAdd,
      w3_can_upload_ls: handleW3CanUploadLs,
      w3_can_upload_rm: handleW3CanUploadRm,
      w3_plan_get: handleW3PlanGet,
      w3_account_ls: handleW3AccountLs,
      w3_space_provision: handleW3SpaceProvision,
      w3_coupon_create: handleW3CouponCreate,
      w3_usage_report: handleW3UsageReport,
      w3_can_access_claim: handleW3CanAccessClaim,
      w3_can_store_add: handleW3CanStoreAdd,
      w3_can_store_ls: handleW3CanStoreLs,
      w3_can_store_rm: handleW3CanStoreRm,
      w3_can_filecoin_info: handleW3CanFilecoinInfo,
      w3_reset: handleW3Reset,
    };
  • Pre-startup validation ensuring the W3_LOGIN_EMAIL environment variable is set, which is required for the w3_login tool to function.
    const loginEmail = process.env["W3_LOGIN_EMAIL"];
    if (!loginEmail) {
      logger.error("Missing environment variable W3_LOGIN_EMAIL. Exiting.");
      process.exit(1);
    }
  • src/index.ts:94-115 (registration)
    The MCP server's CallTool request handler that looks up the tool name in the imported toolHandlers map and invokes the corresponding handler function, effectively registering all tools including w3_login for MCP protocol handling.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
      logger.info(`Handling CallTool request for: ${name}`);
    
      const handler = toolHandlers[name];
    
      if (!handler) {
        logger.error(`Unknown tool requested: ${name}`);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({ error: `Unknown tool: ${name}` }),
            },
          ],
          isError: true,
        };
      }
    
      try {
        const result = await handler(args);
        return result;
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses key behavioral traits: the tool initiates a process requiring email confirmation, may return 'Too Many Requests' errors requiring waiting, and successful authorization is indicated by specific output text ('Agent was authorized by'). It doesn't cover rate limits beyond the error case or detailed auth flow, but provides essential operational context.

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

Conciseness3/5

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

The description is appropriately sized but could be better structured. It front-loads the core purpose, but mixes operational instructions with error handling. Sentences like 'IMPORTANT: The command expects email confirmation...' are clear, but the flow could be more organized. It avoids redundancy but includes some imperative phrasing that might be verbose.

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

Completeness4/5

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

Given the tool's complexity (authentication flow with user interaction), no annotations, no output schema, and 0 parameters, the description is fairly complete. It covers the initiation process, user action required, success indication, and error handling. It doesn't detail the exact output format or all possible error cases, but provides enough for an agent to use it correctly in context.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100%. The description adds value by explaining the email source ('W3_LOGIN_EMAIL env var') and emphasizing user interaction requirements. Since there are no parameters to document, the baseline is 4, and the description provides useful context beyond the empty 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?

The description clearly states the tool 'Initiates the w3 login process using the pre-configured email', which specifies the verb ('initiates') and resource ('w3 login process'). It distinguishes from siblings by focusing on authentication initiation rather than account management or storage operations. However, it doesn't explicitly differentiate from potential login alternatives (though none appear in the sibling list).

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

Usage Guidelines5/5

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

The description provides explicit usage guidelines: 'before running the `w3_login` tool, emphasize ATTENTION to the user... they MUST check email to complete authentication' and 'If the final output includes 'Agent was authorized by'... CONTINUE using mcp-ipfs tools.' It also specifies when to retry: 'Too Many Requests': wait a moment before requesting it again.' This covers when to use, prerequisites, and next steps.

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