Skip to main content
Glama
jongall45

Frontrun MCP Server

by jongall45

frontrun_classify

Classify Twitter users by analyzing their activity with AI and custom rules to identify venture capital signals and trending companies.

Instructions

Run classification on specific entities. Returns AI classification merged with your custom rules and tags. Use this to analyze entities on demand.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernamesNoUsernames to classify
twitter_user_idsNoTwitter user IDs to classify

Implementation Reference

  • The handler function for frontrun_classify tool that takes usernames and/or twitter_user_ids, constructs a request body, and calls the POST /classify API endpoint, returning the result as JSON text.
    async ({ usernames, twitter_user_ids }) => {
      const body = {};
      if (usernames) body.usernames = usernames;
      if (twitter_user_ids) body.twitter_user_ids = twitter_user_ids;
      const result = await apiCall('POST', '/classify', body);
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • Zod schema defining the input parameters for frontrun_classify: optional arrays of usernames and twitter_user_ids, both as strings.
    {
      usernames: z.array(z.string()).optional().describe('Usernames to classify'),
      twitter_user_ids: z.array(z.string()).optional().describe('Twitter user IDs to classify'),
    },
  • index.js:361-375 (registration)
    Registration of the frontrun_classify tool with the MCP server using server.tool(), including the tool name, description, schema, and handler.
    server.tool(
      'frontrun_classify',
      'Run classification on specific entities. Returns AI classification merged with your custom rules and tags. Use this to analyze entities on demand.',
      {
        usernames: z.array(z.string()).optional().describe('Usernames to classify'),
        twitter_user_ids: z.array(z.string()).optional().describe('Twitter user IDs to classify'),
      },
      async ({ usernames, twitter_user_ids }) => {
        const body = {};
        if (usernames) body.usernames = usernames;
        if (twitter_user_ids) body.twitter_user_ids = twitter_user_ids;
        const result = await apiCall('POST', '/classify', body);
        return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
      }
    );
  • Helper function used by frontrun_classify (and other tools) to make authenticated API calls to the Frontrun API with error handling, timeout, and response parsing.
    async function apiCall(method, path, body = null) {
      const url = `${API_URL}/v1${path}`;
      const options = {
        method,
        headers: {
          'X-API-Key': API_KEY,
          'Content-Type': 'application/json',
        },
      };
      if (body) {
        options.body = JSON.stringify(body);
      }
    
      const controller = new AbortController();
      const timeout = setTimeout(() => controller.abort(), 60000);
      options.signal = controller.signal;
    
      let response;
      try {
        response = await fetch(url, options);
      } catch (err) {
        clearTimeout(timeout);
        if (err.name === 'AbortError') return { error: 'Request timed out (60s). Try a narrower query.' };
        return { error: `Network error: ${err.message}` };
      }
      clearTimeout(timeout);
    
      if (response.status === 429) {
        const retry = response.headers.get('Retry-After') || '60';
        return { error: `Rate limited. Retry in ${retry}s.` };
      }
      if (response.status === 401) {
        return { error: 'Invalid API key. Check FRONTRUN_API_KEY.' };
      }
      if (response.status === 402) {
        const data = await response.json();
        return { error: 'Insufficient balance', ...data };
      }
      if (!response.ok) {
        const text = await response.text();
        return { error: `HTTP ${response.status}: ${text.slice(0, 500)}` };
      }
    
      return response.json();
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the tool 'Returns AI classification merged with your custom rules and tags' which hints at read-only analysis rather than mutation, but doesn't clarify permissions needed, rate limits, whether it's synchronous/asynchronous, or what happens with invalid inputs. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is reasonably concise with two sentences that each serve a purpose: the first states the core function, the second provides additional context about the return value and usage timing. However, the second sentence could be more front-loaded with critical information, and some phrasing ('analyze entities on demand') is somewhat redundant with the first sentence.

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?

For a tool with no annotations, no output schema, and 2 parameters, the description is incomplete. It doesn't explain what format the classification results take, what 'AI classification' specifically means, how 'custom rules and tags' are applied, or any error conditions. Given the complexity implied by merging AI analysis with custom rules, the description should provide more context about the operation's behavior and outputs.

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?

Schema description coverage is 100%, so the schema already fully documents both parameters (usernames and twitter_user_ids). The description adds no additional parameter information beyond what's in the schema - it doesn't explain the relationship between these two parameter types, whether both are required, or how they interact. With high schema coverage, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'Run classification on specific entities' which provides a basic verb+resource combination, but it's vague about what 'classification' means in this context. It doesn't clearly distinguish this tool from sibling tools like 'frontrun_tag' or 'frontrun_search' that might also involve entity analysis. The mention of 'AI classification merged with your custom rules and tags' adds some specificity but remains somewhat abstract.

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 minimal guidance with 'Use this to analyze entities on demand' which suggests real-time analysis but doesn't specify when to choose this tool over alternatives like 'frontrun_search' or 'frontrun_trending'. There's no mention of prerequisites, limitations, or explicit comparison with sibling tools, leaving the agent with insufficient context for optimal tool selection.

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/jongall45/frontrun-mcp-server'

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