Skip to main content
Glama
kongyo2

eve-online-mcp

authenticate

Exchange EVE Online SSO authorization codes for access tokens to securely access market data via the MCP server.

Instructions

Exchange authorization code for access token

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesAuthorization code from EVE Online SSO

Implementation Reference

  • Executes the authentication logic by exchanging the authorization code for an access token using getToken, verifying the token to retrieve character info, and returning the details in MCP content format or an error.
    async ({ code }) => {
      try {
        const token = await getToken(code);
        const character = await verifyToken(token.access_token);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                character_name: character.CharacterName,
                character_id: character.CharacterID,
                access_token: token.access_token,
                refresh_token: token.refresh_token,
                expires_in: token.expires_in,
                token_type: token.token_type
              }, null, 2)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Authentication failed: ${error instanceof Error ? error.message : 'Unknown error'}`
            }
          ]
        };
      }
    }
  • Zod schema defining the single input parameter 'code' for the authenticate tool.
    {
      code: z.string().describe("Authorization code from EVE Online SSO")
    },
  • src/index.ts:492-527 (registration)
    MCP server tool registration for 'authenticate', specifying name, description, input schema, and inline handler function.
    server.tool(
      "authenticate",
      "Exchange authorization code for access token",
      {
        code: z.string().describe("Authorization code from EVE Online SSO")
      },
      async ({ code }) => {
        try {
          const token = await getToken(code);
          const character = await verifyToken(token.access_token);
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({
                  character_name: character.CharacterName,
                  character_id: character.CharacterID,
                  access_token: token.access_token,
                  refresh_token: token.refresh_token,
                  expires_in: token.expires_in,
                  token_type: token.token_type
                }, null, 2)
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Authentication failed: ${error instanceof Error ? error.message : 'Unknown error'}`
              }
            ]
          };
        }
      }
  • Helper function to exchange EVE Online SSO authorization code for access and refresh tokens.
    async function getToken(code: string): Promise<EveAuthToken> {
      const response = await fetch("https://login.eveonline.com/v2/oauth/token", {
        method: "POST",
        headers: {
          "Content-Type": "application/x-www-form-urlencoded",
          "Authorization": `Basic ${Buffer.from(`${EVE_CLIENT_ID}:${EVE_CLIENT_SECRET}`).toString("base64")}`
        },
        body: new URLSearchParams({
          grant_type: "authorization_code",
          code: code
        })
      });
    
      if (!response.ok) {
        throw new Error("Failed to get token");
      }
    
      const data = await response.json() as EveAuthToken;
      return {
        ...data,
        issued_at: Date.now()
      };
    }
  • Helper function to verify the access token and retrieve character information.
    async function verifyToken(token: string): Promise<EveCharacter> {
      const response = await fetch("https://login.eveonline.com/oauth/verify", {
        headers: {
          "Authorization": `Bearer ${token}`
        }
      });
    
      if (!response.ok) {
        throw new Error("Failed to verify token");
      }
    
      return response.json() as Promise<EveCharacter>;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the exchange action but fails to describe critical behaviors such as authentication requirements, rate limits, error handling, or the format of the returned access token. For a security-sensitive tool, this lack of detail is a significant gap.

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 a single, direct sentence that efficiently conveys the core functionality without any extraneous words. It is front-loaded with the essential action and resources, making it highly concise and well-structured for quick comprehension.

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

Completeness2/5

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

Given the complexity of an authentication tool with no annotations and no output schema, the description is insufficient. It lacks details on security implications, token lifecycle, error responses, and integration with sibling tools like 'refresh-token', leaving critical context gaps for safe and effective use.

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?

The schema description coverage is 100%, with the single parameter 'code' clearly documented as 'Authorization code from EVE Online SSO'. The description adds no additional semantic information beyond what the schema provides, such as format details or validation rules, so it meets the baseline for adequate but not enhanced coverage.

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 action ('Exchange') and the specific resources involved ('authorization code for access token'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from its sibling 'refresh-token', which also deals with token management, leaving some ambiguity about when to use each.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'refresh-token' or 'get-auth-url', nor does it mention any prerequisites or context for invocation. It merely states what the tool does without indicating the appropriate scenarios for its 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

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/kongyo2/eve-online-mcp'

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