Skip to main content

Second Opinion Tools

Second Opinion tools provide AI challenger feedback from alternative models to help agents validate approaches, find blind spots, and research best practices.

Why Second Opinion?

When working on complex problems, AI agents can get stuck in local optima or miss obvious issues. The Second Opinion tools provide:

  • Challenge mode - Find flaws and edge cases in proposed solutions
  • Alternative mode - Suggest different approaches you might not have considered
  • Validate mode - Assess if a solution will actually work
  • Research mode - Find documentation, GitHub issues, and best practices

When to Use

Use Second Opinion when:

  • You've failed the same task 3+ times
  • You're not sure if your approach is correct
  • Making critical infrastructure changes
  • You want to research best practices before implementing
  • A solution "feels wrong" but you can't articulate why

Architecture

┌─────────────────┐     ┌─────────────┐     ┌────────────────┐
│ MCPammer │────▶│ Artemis │────▶│ OpenRouter / │
│ (MCP Tools) │ │ Gateway │ │ Perplexity │
└─────────────────┘ └─────────────┘ └────────────────┘
│ │
│ ├─ Usage tracking via X-App-Id
│ └─ Unified API key management

└─ File reading with security checks

Second Opinion routes through Artemis LLM Gateway (not direct API calls) for:

  • Unified API key management
  • Per-app usage tracking via X-App-Id: mcpammer header
  • Cost monitoring and rate limiting

Tools

mcpammer_second_opinion

Main tool for getting AI challenger feedback.

Parameters:

ParameterTypeRequiredDescription
contextstringYesProblem description - what are you trying to solve?
proposalstringYesYour proposed solution
file_pathsstring[]NoPaths to code files to review (read server-side)
failuresstring[]NoList of previous failed attempts
modestringNochallenge, alternative, validate, or research (default: challenge)
modelstringNoModel ID (default: anthropic/claude-3.5-sonnet)

Example:

{
"context": "Need to add caching to the API to reduce database load",
"proposal": "Add Redis caching with 5 minute TTL on all GET endpoints",
"file_paths": ["/home/user/project/src/api/routes.py"],
"mode": "challenge"
}

Response includes:

  • Identified issues or concerns
  • Specific recommendations
  • Confidence assessment
  • Alternative approaches (if applicable)

mcpammer_second_opinion_dialogue

Multi-round Socratic dialogue for thorough vetting of critical decisions.

Parameters:

ParameterTypeRequiredDescription
contextstringYesProblem description
proposalstringYesProposed solution
failuresstring[]NoPrevious failed attempts
max_roundsintegerNoMaximum dialogue rounds (default: 3)
challenger_modelstringNoModel for challenger (default: anthropic/claude-3.5-sonnet)

Dialogue rounds:

  1. Challenge round - Find flaws and edge cases
  2. Research round - Verify against documentation
  3. Validation round - Final recommendation

mcpammer_second_opinion_quick

Quick yes/no validation check. Use for fast sanity checks.

Parameters:

ParameterTypeRequiredDescription
contextstringYesProblem description
proposalstringYesProposed solution

Response:

{
"likely_to_work": true,
"confidence": "high",
"brief_reasoning": "Standard pattern, well-supported approach"
}

mcpammer_second_opinion_models

List recommended models for second opinions.

Response includes:

  • Model ID and display name
  • Strengths (coding, research, reasoning)
  • Cost tier
  • Recommended use cases

Search all available OpenRouter models.

Parameters:

ParameterTypeRequiredDescription
searchstringNoSearch term (e.g., "gemini", "gpt-4")
categorystringNoFilter by category

Modes Explained

Challenge Mode

Actively tries to find problems with your solution.

Best for:

  • Code review before commit
  • Architecture decisions
  • Security-sensitive changes

Prompt focus:

  • Edge cases and failure scenarios
  • Performance implications
  • Security vulnerabilities
  • Maintainability concerns

Alternative Mode

Suggests completely different approaches.

Best for:

  • When you're stuck on one approach
  • Exploring solution space
  • Learning new patterns

Prompt focus:

  • Different architectural patterns
  • Trade-off analysis
  • Industry best practices

Validate Mode

Assesses likelihood of success.

Best for:

  • Final check before implementation
  • Confidence calibration
  • Go/no-go decisions

Prompt focus:

  • Feasibility assessment
  • Risk identification
  • Success probability

Research Mode

Searches web for documentation and best practices. Uses Perplexity models with web search capability.

Best for:

  • Finding official documentation
  • Discovering known issues
  • Learning from others' solutions

Prompt focus:

  • Official docs and guides
  • GitHub issues and discussions
  • Stack Overflow solutions
  • Blog posts and tutorials

File Reading Security

When you pass file_paths, the MCP server reads files locally with security checks:

CheckLimit
Max file size500KB per file
Max files20 files per request
Blocked patterns.env, credentials, secrets, .pem, .key, id_rsa, .git/config
Allowed directoriesHome directory, CWD, /tmp

Files are read server-side to save tokens in the main conversation context.

Available Models

ModelBest ForNotes
anthropic/claude-3.5-sonnetResearch, generalWeb search enabled, default
openai/gpt-4oCode reviewStrong reasoning
anthropic/claude-3.5-sonnetArchitectureGood at trade-offs
google/gemini-pro-1.5Long context1M token context

Perplexity Models (Research Mode)

ModelContextNotes
llama-3.1-sonar-small-128k-online128KFast, economical
llama-3.1-sonar-large-128k-online128KBalanced
llama-3.1-sonar-huge-128k-online128KMost capable

Usage Tracking

All Second Opinion calls are tracked via Artemis:

Best Practices

Do

  • Provide clear context about what you're trying to achieve
  • Include relevant file paths for code-related questions
  • List previous failures to avoid repeated suggestions
  • Use research mode before implementing unfamiliar patterns
  • Use dialogue mode for critical infrastructure changes

Don't

  • Use for trivial decisions (adds latency and cost)
  • Ignore the feedback (defeats the purpose)
  • Pass sensitive files (credentials, secrets)
  • Use as a replacement for testing

Case Studies

Real examples of Second Opinion in action: