Skip to main content
Glama

Ask Coding Advisors

ask-coding-advisors

Get coding assistance by querying three AI specialists simultaneously with automatic premium fallback, returning multiple expert opinions for debugging and problem-solving.

Instructions

Queries three OpenRouter coding specialists (free tier) and falls back to premium models when rate limited.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
questionYes
contextNo

Implementation Reference

  • Zod input schema definition for the 'ask-coding-advisors' tool, specifying 'question' (required, 4-4000 chars) and optional 'context' (max 12000 chars).
    const inputSchema = z.object({
      question: z
        .string()
        .min(4, 'Bitte fasse dein Problem in mindestens vier Zeichen zusammen.')
        .max(4000, 'Question too long (4k char cap).'),
      context: z.string().max(12000).optional(),
    });
  • src/server.ts:44-87 (registration)
    MCP server registration of the 'ask-coding-advisors' tool, including title, description, input schema reference, and the handler function.
    server.registerTool(
      'ask-coding-advisors',
      {
        title: 'Ask Coding Advisors',
        description:
          'Queries three OpenRouter coding specialists (free tier) and falls back to premium models when rate limited.',
        inputSchema,
      },
      async (args) => {
        const input: ToolInput = typeof args.context === 'string' && args.context.length > 0
          ? { question: args.question, context: args.context }
          : { question: args.question };
    
        try {
          const batch = await coordinator.advise(input);
          const formatted = formatBatch(batch);
          return {
            content: [
              {
                type: 'text',
                text: formatted,
              },
            ],
          };
        } catch (error) {
          const prefix = 'Coding advisor tool failed';
          const message =
            error instanceof Error ? `${prefix}: ${error.message}` : `${prefix}: ${String(error)}`;
    
          const isRetryable = error instanceof RateLimitError || error instanceof OpenRouterError;
    
          return {
            isError: isRetryable,
            content: [
              {
                type: 'text',
                text: message,
              },
            ],
          };
        }
      }
    );
  • The handler function registered for the tool. Parses args, calls CodingAdvisorCoordinator.advise(), formats results with formatBatch, handles errors including rate limits.
      async (args) => {
        const input: ToolInput = typeof args.context === 'string' && args.context.length > 0
          ? { question: args.question, context: args.context }
          : { question: args.question };
    
        try {
          const batch = await coordinator.advise(input);
          const formatted = formatBatch(batch);
          return {
            content: [
              {
                type: 'text',
                text: formatted,
              },
            ],
          };
        } catch (error) {
          const prefix = 'Coding advisor tool failed';
          const message =
            error instanceof Error ? `${prefix}: ${error.message}` : `${prefix}: ${String(error)}`;
    
          const isRetryable = error instanceof RateLimitError || error instanceof OpenRouterError;
    
          return {
            isError: isRetryable,
            content: [
              {
                type: 'text',
                text: message,
              },
            ],
          };
        }
      }
    );
  • Core execution logic in CodingAdvisorCoordinator.advise(): Builds model lineup, tries up to 3 free models first, falls back to paid if rate-limited or insufficient, collects responses.
    async advise(input: ToolInput): Promise<AdvisorBatchResult> {
      const answers: AdvisorCallResult[] = [];
      const lineup = buildModelLineup(input);
      let fallbackTriggered = false;
    
      const freePool = this.freeDisabled ? [] : lineup.free;
    
      for (const spec of freePool) {
        if (answers.length >= 3) break;
        const outcome = await this.tryModel(spec, lineup.tags, input, false);
        if (outcome?.type === 'rate-limit') {
          fallbackTriggered = true;
          break;
        }
        if (outcome?.result) {
          answers.push(outcome.result);
        }
        if (this.freeDisabled) {
          break;
        }
      }
    
      if (answers.length < 3) {
        fallbackTriggered = true;
        for (const spec of lineup.paid) {
          if (answers.length >= 3) break;
          const outcome = await this.tryModel(spec, lineup.tags, input, true);
          if (outcome?.result) {
            answers.push(outcome.result);
          }
        }
      }
    
      if (answers.length < 3) {
        throw new Error('Keine gesunden OpenRouter-Modelle verfügbar – bitte später erneut versuchen.');
      }
    
      return { answers, fallbackTriggered };
    }
  • Helper function to format the batch of advisor responses into a readable markdown-like text with headers, tiers, latency, and usage.
    function formatBatch(batch: AdvisorBatchResult): string {
      const header = batch.fallbackTriggered
        ? '⚠️ OpenRouter rate limit hit — switched to paid fallbacks for the remaining slots.\n'
        : '';
    
      const body = batch.answers
        .map((answer, index) => {
          const tier = answer.isFree ? 'free tier' : answer.usedFallback ? 'paid fallback' : 'paid';
          const latency = formatLatency(answer.latencyMs);
          const usageBits = formatUsage(answer.usage);
    
          return [
            `Advisor ${index + 1}: ${answer.modelLabel} (${tier})`,
            `Focus: ${answer.focus}`,
            `Latency: ${latency}${usageBits ? ` | Usage: ${usageBits}` : ''}`,
            '',
            answer.responseText,
          ].join('\n');
        })
        .join('\n\n---\n\n');
    
      return header + body;
    }
Behavior3/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 adds useful context: it queries three specialists (implying multiple responses or aggregation), uses free tier models, and has a fallback mechanism for rate limits. However, it doesn't cover other key behaviors like response format, error handling beyond rate limits, or whether it's read-only or mutative, leaving gaps in transparency.

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, efficient sentence that front-loads the core action ('Queries three OpenRouter coding specialists') and adds necessary details (free tier, fallback) without waste. Every part earns its place, making it highly concise and well-structured.

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 (querying multiple models with fallback), no annotations, no output schema, and 0% schema description coverage, the description is incomplete. It lacks details on parameter usage, response format, error handling beyond rate limits, and other operational aspects, making it inadequate for full contextual understanding despite its conciseness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 2 parameters with 0% description coverage, so the description must compensate. It provides no information about the parameters (e.g., what 'question' and 'context' represent, their expected content, or how they're used in the query). This fails to add meaning beyond the bare schema, resulting in a low score due to the high burden from lack of schema documentation.

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 tool's purpose: it queries three OpenRouter coding specialists. It specifies the service (OpenRouter), the type of specialists (coding), and the quantity (three). However, it doesn't distinguish from siblings since there are none, so it can't achieve a perfect score for sibling differentiation.

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

Usage Guidelines3/5

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

The description implies usage context by mentioning 'free tier' and 'falls back to premium models when rate limited,' suggesting it's suitable for general coding queries with fallback handling. However, it lacks explicit guidance on when to use this tool versus alternatives (e.g., other query tools or direct model calls), and there are no siblings to compare against, so the guidance is limited to implied context.

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/meinzeug/mcp-ai-bug-helper'

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