Skip to main content
Glama

configure_api_token

Set or update the Railway API token for authentication in railway-mcp server. Use this tool during initial setup or token changes to enable secure API access.

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 async handler function that implements the 'configure_api_token' tool logic. It sets the API token via railwayClient.setToken and returns a success or error message.
    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'}`,
            },
          ],
        };
      }
    }
  • The Zod input schema for the tool, requiring a 'token' string parameter.
      token: z.string().describe("Railway API token (create one at https://railway.app/account/tokens)")
    },
    async ({ token }) => {
  • The tool 'configure_api_token' is registered/created using createTool, which defines its name, description, schema, and handler. This is part of the exported configTools array.
    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'}`,
              },
            ],
          };
        }
      }
    )

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