Skip to main content
Glama

configure_api_token

Set up or update the Railway API token for authentication when not configured in environment variables. This tool handles initial token configuration and authentication setup.

Instructions

[UTILITY] Configure the Railway API token for authentication (only needed if not set in environment variables)

⚡️ Best for: ✓ Initial setup ✓ Token updates ✓ Authentication configuration

⚠️ Not for: × Project configuration × Service settings × Environment variables

→ Next steps: project_list, service_list

→ Related: project_create

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesRailway API token (create one at https://railway.app/account/tokens)

Implementation Reference

  • Handler function that sets the Railway API token using railwayClient.setToken and returns a success or error message in the expected format.
    async ({ token }) => {
      try {
        await railwayClient.setToken(token);      
        return {
          content: [
            {
              type: "text" as const,
              text: `✅ Successfully connected to Railway API`,
            },
          ],
        };
      } catch (error) {
        return {
          isError: true,
          content: [
            {
              type: "text" as const,
              text: `❌ Failed to connect to Railway API: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
        };
      }
    }
  • Zod schema defining the input parameter 'token' for the tool.
    {
      token: z.string().describe("Railway API token (create one at https://railway.app/account/tokens)")
    },
  • The tool 'configure_api_token' is defined and registered using createTool within the configTools export array, which is later imported and registered in src/tools/index.ts.
    createTool(
      "configure_api_token",
      formatToolDescription({
        type: 'UTILITY',
        description: "Configure the Railway API token for authentication (only needed if not set in environment variables)",
        bestFor: [
          "Initial setup",
          "Token updates",
          "Authentication configuration"
        ],
        notFor: [
          "Project configuration",
          "Service settings",
          "Environment variables"
        ],
        relations: {
          nextSteps: ["project_list", "service_list"],
          related: ["project_create"]
        }
      }),
      {
        token: z.string().describe("Railway API token (create one at https://railway.app/account/tokens)")
      },
      async ({ token }) => {
        try {
          await railwayClient.setToken(token);      
          return {
            content: [
              {
                type: "text" as const,
                text: `✅ Successfully connected to Railway API`,
              },
            ],
          };
        } catch (error) {
          return {
            isError: true,
            content: [
              {
                type: "text" as const,
                text: `❌ Failed to connect to Railway API: ${error instanceof Error ? error.message : 'Unknown error'}`,
              },
            ],
          };
        }
      }
    )
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 that the tool is for authentication configuration and mentions it's 'only needed if not set in environment variables', adding useful context about prerequisites. However, it lacks details on behavioral traits like whether this is a one-time setup, if it persists across sessions, error handling, or rate limits, leaving gaps for a mutation tool.

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 well-structured and appropriately sized, using bullet points (✓ and ×) and arrows (→) for clarity. It is front-loaded with the core purpose, followed by best uses, exclusions, and related tools, with every sentence adding value and no wasted words.

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 (single parameter, no output schema, no annotations), the description is mostly complete. It covers purpose, usage, and exclusions well. However, as a mutation tool with no annotations, it could benefit from more behavioral details (e.g., side effects, error cases), slightly reducing completeness.

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 fully documenting the single 'token' parameter. The description does not add any parameter-specific semantics beyond what's in the schema (e.g., no extra details on token format or validation). According to the rules, with high schema coverage, the baseline is 3 even without param info in the description.

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: 'Configure the Railway API token for authentication' with the specific verb 'configure' and resource 'API token'. It distinguishes from siblings by explicitly stating what it's not for (project configuration, service settings, environment variables), making it distinct from tools like project_create, service_list, or variable_set.

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 it ('Initial setup', 'Token updates', 'Authentication configuration') and when not to use it ('Not for: Project configuration, Service settings, Environment variables'). It also suggests next steps (project_list, service_list) and related tools (project_create), offering clear alternatives and 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/epitaphe360/railway-mcp'

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