Skip to main content
Glama

configure_api_token

Set or update the Railway API token for authentication. Required if not already configured in environment variables.

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

  • The handler function for the configure_api_token tool. It receives a token string, calls railwayClient.setToken(token) to set the API token, and returns success/error responses.
    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'}`,
            },
          ],
        };
      }
    }
  • Input schema for the configure_api_token tool: a single 'token' string parameter described as 'Railway API token (create one at https://railway.app/account/tokens)'.
      token: z.string().describe("Railway API token (create one at https://railway.app/account/tokens)")
    },
  • Registration of all tools including configTools (which contains configure_api_token) via server.tool(...) in the registerAllTools function.
      // Register each tool with the server
      allTools.forEach((tool) => {
        server.tool(
          ...tool
        );
      });
    } 
  • The createTool helper function used to construct the tool tuple (name, description, schema, handler) for configure_api_token.
    export function createTool<T extends z.ZodRawShape>(
      name: string,
      description: string,
      schema: T,
      handler: ToolCallback<T>
    ): Tool<T> {
      return [
        name,
        description,
        schema,
        handler
      ] as const;
    } 
  • The setToken method on RailwayApiClient that the handler calls to set and validate the API token.
    async setToken(token: string | null): Promise<void> {
      this.token = token;
      if (token) {
        await this.validateToken();
      }
    }
Behavior3/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 the tool configures a token for authentication but does not disclose side effects (e.g., overwriting existing token, persistence, validation). For a simple setter, the purpose is clear but behavioral details are missing, making it adequate but not comprehensive.

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 concise and well-structured, using emojis, checkmarks, and cross marks to denote best uses and exclusions. It is front-loaded with the purpose and includes next steps and related tools. Every sentence adds value with no redundancy.

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 simplicity (one parameter, no output schema, no annotations), the description is fairly complete. It covers purpose, usage scenarios, and exclusions. However, it lacks details on response or error handling, but for a configuration tool, the level of detail is appropriate. Slightly more could be said about behavioral side effects.

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 input schema already describes the token parameter with a URL to create one. The description adds value by noting it is only needed if not set in environment variables, which provides context beyond the schema. With 100% schema coverage, the description enhances usability.

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 configures the Railway API token for authentication, and distinguishes it from project, service, and environment variable configuration. It uses specific verbs and resources, and the 'Best for' and 'Not for' sections further clarify its scope.

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 explicitly says it is only needed if the token is not set in environment variables, and provides best-use cases (initial setup, token updates, authentication configuration) and exclusions (project configuration, service settings, environment variables). It also suggests next steps and related tools, giving clear guidance on when to use.

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/jason-tan-swe/railway-mcp'

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