Skip to main content
Glama

crafty_login

Authenticate to Crafty Controller using username and password credentials to obtain a bearer token for API access.

Instructions

Login with username and password to get a bearer token. Use this if you prefer username/password authentication over a pre-generated API token.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesCrafty Controller username
passwordYesCrafty Controller password
totpNoTOTP/2FA code (required if MFA is enabled on the account)

Implementation Reference

  • The handler function for the crafty_login tool.
    async ({ username, password, totp }) => {
      try {
        const data = await client.login(username, password, totp);
        return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
      } catch (error) {
        const msg = error instanceof Error ? error.message : String(error);
        return { content: [{ type: "text", text: `Error: ${msg}` }], isError: true };
      }
    }
  • Zod schema definition for crafty_login input arguments.
    {
      username: z.string().describe("Crafty Controller username"),
      password: z.string().describe("Crafty Controller password"),
      totp: z
        .string()
        .optional()
        .describe("TOTP/2FA code (required if MFA is enabled on the account)"),
    },
  • src/tools/auth.ts:6-26 (registration)
    Registration of the crafty_login tool within the MCP server.
    server.tool(
      "crafty_login",
      "Login with username and password to get a bearer token. Use this if you prefer username/password authentication over a pre-generated API token.",
      {
        username: z.string().describe("Crafty Controller username"),
        password: z.string().describe("Crafty Controller password"),
        totp: z
          .string()
          .optional()
          .describe("TOTP/2FA code (required if MFA is enabled on the account)"),
      },
      async ({ username, password, totp }) => {
        try {
          const data = await client.login(username, password, totp);
          return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
        } catch (error) {
          const msg = error instanceof Error ? error.message : String(error);
          return { content: [{ type: "text", text: `Error: ${msg}` }], isError: true };
        }
      }
    );
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the behavioral outcome (obtaining a bearer token) and mentions MFA requirements indirectly via the TOTP parameter note. However, it lacks details on error conditions, rate limits, session duration, or security implications. The description adds some context but doesn't fully compensate for the absence of annotations.

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 two sentences with zero waste. The first sentence states the core purpose, and the second provides usage guidance. Every word earns its place, and the information is front-loaded appropriately for quick understanding.

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 moderate complexity (authentication with optional MFA), no annotations, and no output schema, the description does well by explaining the purpose and when to use it. However, it lacks details on the bearer token's format, expiration, or how to use it in subsequent requests. For an authentication tool without output schema, this is a minor gap, but the description is mostly complete.

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?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description doesn't add specific parameter semantics beyond what's in the schema, but it implicitly reinforces the purpose of username/password for authentication. With high schema coverage, the baseline is 3, but the description's clear linkage to the tool's purpose justifies a slightly higher score.

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's purpose: 'Login with username and password to get a bearer token.' It specifies the verb (login), resources (username/password), and outcome (bearer token). It also distinguishes this authentication method from alternatives by mentioning 'pre-generated API token,' making it distinct from sibling tools that don't handle authentication.

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 guidance on when to use this tool: 'Use this if you prefer username/password authentication over a pre-generated API token.' This directly addresses the alternative authentication method and gives clear context for choosing this tool over other approaches, though it doesn't mention specific sibling tools since authentication is unique in this context.

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/HadiCherkaoui/crafty-mcp'

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