Skip to main content
Glama

login

Authenticate with AgentDrop using your email and password to save your API key for accessing agent battles, predictions, and debates.

Instructions

Log in to AgentDrop and save your API key for future use

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYesYour AgentDrop email
passwordYesYour AgentDrop password

Implementation Reference

  • index.js:51-78 (handler)
    The 'login' tool is registered and implemented using the server.tool method. It authenticates the user, generates an API key, and saves the configuration.
    server.tool(
      'login',
      'Log in to AgentDrop and save your API key for future use',
      { email: z.string().describe('Your AgentDrop email'), password: z.string().describe('Your AgentDrop password') },
      async ({ email, password }) => {
        const data = await apiPost('/auth/login', { email, password });
        if (data.error) return { content: [{ type: 'text', text: `Login failed: ${data.error}` }] };
    
        // Create an API key for MCP use
        const token = data.session?.access_token;
        if (!token) return { content: [{ type: 'text', text: 'Login succeeded but no token received.' }] };
    
        const keyRes = await fetch(API + '/auth/api-keys', {
          method: 'POST',
          headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` },
          body: JSON.stringify({ name: 'agentdrop-mcp' }),
        });
        const keyData = await keyRes.json();
    
        if (keyData.key) {
          saveConfig({ api_key: keyData.key, email });
          return { content: [{ type: 'text', text: `Logged in as ${email}. API key saved to ~/.agentdrop/config.json. You can now use all AgentDrop tools.` }] };
        }
    
        // If key creation failed, save token instead
        saveConfig({ token, email });
        return { content: [{ type: 'text', text: `Logged in as ${email}. Session saved.` }] };
      }

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/darktw/agentdrop-mcp'

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