Skip to main content
Glama
stackexchange-mcp

stackexchange-mcp

by YashLimbani

search_by_error_message

Read-onlyIdempotent

Searches Stack Overflow for discussions matching a pasted error message or stack trace, cleans noisy paths and addresses, and returns the exact query used to find relevant debugging answers.

Instructions

Find Stack Overflow discussions that match an error message or stack trace.

Use this when the user pastes an error. The tool picks the most informative line and strips file paths, line numbers and memory addresses before searching; the query it actually used is returned as cleaned_query. Adding a language tag helps. Use get_question on a promising result to read the answers.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "error_message": "<error_message>"
    },
    "name": "search_by_error_message"
  }
}

Input Schema

NameRequiredDescriptionDefault
siteNoStack Exchange site slug, e.g. 'stackoverflow'.stackoverflow
tagsNoOptional language/framework tags to improve precision, e.g. ['python'] (max 5).
limitNoNumber of results to return.
error_messageYesThe error text or stack trace exactly as the user pasted it.

Output Schema

NameRequiredDescriptionDefault
noteNo
resultsYes
has_moreYes
cleaned_queryYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare readOnly, idempotent, openWorld and non-destructive behavior, so the description adds genuinely non-obvious context: the tool rewrites the input by selecting the most informative line and stripping file paths, line numbers and memory addresses, and it returns the actual query as cleaned_query. That normalization is behavior an agent could not infer from the annotations or schema and materially affects interpretation of results.

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?

Short, front-loaded paragraphs: purpose first, trigger second, non-obvious behavior third, follow-up last. Every sentence carries information an agent needs, and nothing repeats the schema or annotations.

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

Completeness4/5

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

Given an output schema exists, the description need not explain return values, and it covers the key gaps: when to call it, the query-normalization behavior, and the next step for reading answers. Only the absence of explicit guidance on when to prefer search_questions over this tool leaves a small gap.

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 all four parameters (site, tags, limit, error_message) are already documented, and 'adding a language tag helps' largely restates what the tags parameter description says about improving precision. The description adds no syntax, format, or bounds detail beyond the schema, so the baseline of 3 is appropriate.

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

Purpose5/5

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

The description names a specific verb and resource ('Find Stack Overflow discussions') and narrows the scope to error messages or stack traces, which separates it from the general keyword sibling search_questions. The preprocessing summary makes the tool's distinctive behavior clear before the agent opens the schema.

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

Usage Guidelines4/5

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

'Use this when the user pastes an error' gives an explicit trigger condition, and 'Use get_question on a promising result' routes the agent to the correct follow-up tool. It also suggests adding a language tag for precision. It lacks an explicit when-not (e.g., use search_questions for plain keyword queries), so it stops short of a full 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.