Skip to main content
Glama

getSecondOpinion

Leverage diverse LLM providers to generate responses tailored to your prompts. Select providers, configure models, and adjust parameters for dynamic AI-driven insights on the MindBridge MCP Server.

Instructions

Get responses from various LLM providers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
frequency_penaltyNo
maxTokensNo
modelYes
presence_penaltyNo
promptYes
providerYes
reasoning_effortNo
stop_sequencesNo
streamNo
systemPromptNo
temperatureNo
top_kNo
top_pNo

Implementation Reference

  • The main execution handler for the getSecondOpinion tool. Validates provider and model, fetches the provider instance, calls its getResponse method with input params, and returns formatted LLM response or error.
    async (params) => {
      try {
        // Validate provider exists
        const providerName = params.provider.toLowerCase();
        if (!this.providerFactory.hasProvider(providerName)) {
          const availableProviders = this.providerFactory.getAvailableProviders();
          throw new Error(
            `Provider "${params.provider}" not configured. Available providers: ${availableProviders.join(', ')}`
          );
        }
    
        const provider = this.providerFactory.getProvider(providerName)!;
    
        // Validate model exists for provider
        if (!provider.isValidModel(params.model)) {
          const availableModels = provider.getAvailableModels();
          throw new Error(
            `Model "${params.model}" not found for provider "${params.provider}". Available models: ${availableModels.join(', ')}`
          );
        }
    
        // Check reasoning effort compatibility
        if (params.reasoning_effort && !provider.supportsReasoningEffort()) {
          console.warn(
            `Warning: Provider "${params.provider}" does not support reasoning_effort parameter. It will be ignored.`
          );
        }
    
        // Get response from provider
        const result = await provider.getResponse(params);
    
        if (result.isError) {
          return {
            content: [{ type: 'text', text: `Error: ${result.content[0].text}` }],
            isError: true
          };
        }
    
        return {
          content: result.content
        };
      } catch (error) {
        return {
          content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : 'An unknown error occurred'}` }],
          isError: true
        };
      }
    }
  • src/server.ts:29-80 (registration)
    Registration of the getSecondOpinion tool in the MCP server using this.tool(), providing name, description, Zod schema, and inline handler function.
    this.tool('getSecondOpinion',
      'Get responses from various LLM providers',
      GetSecondOpinionSchema.shape,
      async (params) => {
        try {
          // Validate provider exists
          const providerName = params.provider.toLowerCase();
          if (!this.providerFactory.hasProvider(providerName)) {
            const availableProviders = this.providerFactory.getAvailableProviders();
            throw new Error(
              `Provider "${params.provider}" not configured. Available providers: ${availableProviders.join(', ')}`
            );
          }
    
          const provider = this.providerFactory.getProvider(providerName)!;
    
          // Validate model exists for provider
          if (!provider.isValidModel(params.model)) {
            const availableModels = provider.getAvailableModels();
            throw new Error(
              `Model "${params.model}" not found for provider "${params.provider}". Available models: ${availableModels.join(', ')}`
            );
          }
    
          // Check reasoning effort compatibility
          if (params.reasoning_effort && !provider.supportsReasoningEffort()) {
            console.warn(
              `Warning: Provider "${params.provider}" does not support reasoning_effort parameter. It will be ignored.`
            );
          }
    
          // Get response from provider
          const result = await provider.getResponse(params);
    
          if (result.isError) {
            return {
              content: [{ type: 'text', text: `Error: ${result.content[0].text}` }],
              isError: true
            };
          }
    
          return {
            content: result.content
          };
        } catch (error) {
          return {
            content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : 'An unknown error occurred'}` }],
            isError: true
          };
        }
      }
    );
  • Zod schema defining the input structure for the getSecondOpinion tool, including required fields like prompt, provider, model, and optional LLM-specific parameters.
    export const GetSecondOpinionSchema = z.object({
      prompt: z.string().min(1),
      provider: LLMProvider,
      model: z.string().min(1),
      systemPrompt: z.string().optional().nullable(),
      temperature: z.number().min(0).max(1).optional(),
      maxTokens: z.number().positive().optional().default(1024),
      reasoning_effort: z.union([ // Primarily for OpenAI o-series
        z.literal('low'),
        z.literal('medium'),
        z.literal('high')
      ]).optional().nullable(),
      // Add other potential parameters if needed based on updated APIs
      top_p: z.number().min(0).max(1).optional(),
      top_k: z.number().positive().optional(),
      stop_sequences: z.array(z.string()).optional(),
      stream: z.boolean().optional(), // For Google Gemini
      frequency_penalty: z.number().min(-2.0).max(2.0).optional(), // For OpenAI
      presence_penalty: z.number().min(-2.0).max(2.0).optional() // For OpenAI
    });
Behavior1/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. The description only states 'Get responses from various LLM providers' without mentioning any behavioral traits such as whether this is a read-only operation, potential costs, rate limits, authentication needs, error handling, or what the output looks like. For a tool with 13 parameters and no output schema, this leaves critical operational context unspecified.

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 with zero wasted words. It's front-loaded and directly states the core function. While it lacks detail, it's not verbose or poorly structured—it's appropriately concise for its limited content.

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

Completeness1/5

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

Given high complexity (13 parameters, no annotations, no output schema), the description is severely incomplete. It doesn't explain what the tool returns, how to interpret parameters, behavioral constraints, or differentiation from siblings. For a multi-provider LLM query tool with rich parameterization, this minimal description fails to provide necessary context for effective use.

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

Parameters1/5

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

Schema description coverage is 0%, meaning none of the 13 parameters have descriptions in the schema. The tool description provides no information about any parameters—it doesn't mention the required parameters (prompt, provider, model) or optional ones like temperature or maxTokens. With such low coverage and no compensation in the description, an agent has no semantic guidance beyond raw schema constraints.

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 'Get responses from various LLM providers' states a general purpose but lacks specificity about what kind of responses or how it differs from siblings. It mentions 'various LLM providers' which hints at multi-provider capability, but doesn't clearly distinguish from listProviders (which likely lists providers) or listReasoningModels (which likely lists models). The verb 'Get responses' is somewhat vague compared to more precise alternatives like 'Generate completions' or 'Query LLMs'.

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?

No guidance is provided on when to use this tool versus its siblings (listProviders, listReasoningModels). The description doesn't mention prerequisites, alternatives, or specific contexts for usage. It's implied this is for generating LLM responses, but without explicit boundaries or comparisons to other tools, an agent might struggle to choose appropriately between querying and listing functions.

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/pinkpixel-dev/mindbridge-mcp'

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