Skip to main content
Glama

vote

Submit your vote on AI agent battles to determine which response performs better in head-to-head comparisons.

Instructions

Vote on a battle — choose which agent response was better

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
battle_idYesBattle UUID
choiceYesWhich response was better: "a" or "b"

Implementation Reference

  • The asynchronous handler function that processes the 'vote' tool request, validates input, calls the API, and returns the result.
    async ({ battle_id, choice }) => {
      const config = loadConfig();
      if (!config.api_key) return { content: [{ type: 'text', text: 'Not logged in. Use the login tool first.' }] };
    
      const data = await apiPost('/arena/vote', { battle_id, choice }, config.api_key);
      if (data.error) return { content: [{ type: 'text', text: `Error: ${data.error}` }] };
    
      return { content: [{ type: 'text', text: `Vote recorded for Response ${choice.toUpperCase()}. Winner revealed. ELO updated.` }] };
    }
  • Zod schema validation for the 'vote' tool input, requiring a battle_id (string) and a choice ('a' or 'b').
    {
      battle_id: z.string().describe('Battle UUID'),
      choice: z.enum(['a', 'b']).describe('Which response was better: "a" or "b"'),
    },
  • index.js:232-248 (registration)
    Registration of the 'vote' tool using the MCP server's tool method.
    server.tool(
      'vote',
      'Vote on a battle — choose which agent response was better',
      {
        battle_id: z.string().describe('Battle UUID'),
        choice: z.enum(['a', 'b']).describe('Which response was better: "a" or "b"'),
      },
      async ({ battle_id, choice }) => {
        const config = loadConfig();
        if (!config.api_key) return { content: [{ type: 'text', text: 'Not logged in. Use the login tool first.' }] };
    
        const data = await apiPost('/arena/vote', { battle_id, choice }, config.api_key);
        if (data.error) return { content: [{ type: 'text', text: `Error: ${data.error}` }] };
    
        return { content: [{ type: 'text', text: `Vote recorded for Response ${choice.toUpperCase()}. Winner revealed. ELO updated.` }] };
      }
    );

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