Skip to main content
Glama

stackexchange-mcp-server

Get Stack Exchange User Profile

stackexchange_get_user
Read-onlyIdempotent

Fetch a Stack Exchange user profile by numeric user ID: reputation, badge counts, answer and question counts, account and last-access dates, and top tags by answer score. Useful for credibility context on an answer author — pass the authorUserId from any question or answer in stackexchange_get_thread output. Returns profile fields plus up to 10 top tags by answer score.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteNoStack Exchange site — use the api_site_parameter value (e.g. "stackoverflow", "superuser"). Defaults to "stackoverflow". Call stackexchange_list_sites to discover valid values.stackoverflow
userIdYesNumeric user ID (at most 2147483647) — use the authorUserId field from a question or answer in stackexchange_get_thread output.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
linkNoDirect URL to the user profile.
errorNoPresent when the call failed. Absent on success.
userIdNoNumeric user ID on this Stack Exchange site.
topTagsNoTop tags by answer score (up to 10). Empty array for new users with no answers.
locationNoUser-provided location string when available.
quotaMaxNoMaximum API quota calls per day (300 keyless, ~10,000 with API key).
reputationNoUser reputation score.
websiteUrlNoUser-provided website URL when available.
answerCountNoTotal number of answers posted when provided by the API.
badgeCountsNoBadge counts when provided by the API.
displayNameNoDisplay name shown on the site.
creationDateNoISO 8601 timestamp of when the account was created — the account age.
questionCountNoTotal number of questions posted when provided by the API.
lastAccessDateNoISO 8601 timestamp of the last time the user accessed the site — a stale value means the author is unlikely to respond.
quotaRemainingNoRemaining API quota calls for the current day.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `user_not_found`: The user lookup returns an empty result set — SE returns HTTP 200 with no items for unknown user IDs rather than 404. `invalid_user_id`: userId is above 2147483647 — Stack Exchange user IDs are 32-bit signed integers. `invalid_site`: The provided site value is not a valid Stack Exchange network site identifier. `invalid_parameter`: Stack Exchange rejected a request parameter and named the field rather than reporting a bad site. `quota_exceeded`: The Stack Exchange API quota_remaining has reached 0. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `user_not_found`: The user lookup returns an empty result set — SE returns HTTP 200 with no items for unknown user IDs rather than 404. `invalid_user_id`: userId is above 2147483647 — Stack Exchange user IDs are 32-bit signed integers. `invalid_site`: The provided site value is not a valid Stack Exchange network site identifier. `invalid_parameter`: Stack Exchange rejected a request parameter and named the field rather than reporting a bad site. `quota_exceeded`: The Stack Exchange API quota_remaining has reached 0. `invalid_api_key`: Stack Exchange does not recognize the API key this server is configured with. `upstream_unavailable`: Stack Exchange answered with a body that is not the expected JSON envelope. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "user_not_found",
      -  "invalid_user_id",
      -  "invalid_site",
      -  "invalid_parameter",
      -  "quota_exceeded"
      -]New value: +[
      +  "user_not_found",
      +  "invalid_user_id",
      +  "invalid_site",
      +  "invalid_parameter",
      +  "quota_exceeded",
      +  "invalid_api_key",
      +  "upstream_unavailable"
      +]
  2. Changed5 schema fields changed
    • changedInput schema / properties / userId / description
      Previous value: -"Numeric user ID — use the authorUserId field from a question or answer in stackexchange_get_thread output."New value: +"Numeric user ID (at most 2147483647) — use the authorUserId field from a question or answer in stackexchange_get_thread output."
    • addedOutput schema / properties / creationDate
      Added value: +{
      +  "description": "ISO 8601 timestamp of when the account was created — the account age.",
      +  "type": "string"
      +}
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `user_not_found`: The user lookup returns an empty result set — SE returns HTTP 200 with no items for unknown user IDs rather than 404. `invalid_site`: The provided site value is not a valid Stack Exchange network site identifier. `quota_exceeded`: The Stack Exchange API quota_remaining has reached 0. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `user_not_found`: The user lookup returns an empty result set — SE returns HTTP 200 with no items for unknown user IDs rather than 404. `invalid_user_id`: userId is above 2147483647 — Stack Exchange user IDs are 32-bit signed integers. `invalid_site`: The provided site value is not a valid Stack Exchange network site identifier. `invalid_parameter`: Stack Exchange rejected a request parameter and named the field rather than reporting a bad site. `quota_exceeded`: The Stack Exchange API quota_remaining has reached 0. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "user_not_found",
      -  "invalid_site",
      -  "quota_exceeded"
      -]New value: +[
      +  "user_not_found",
      +  "invalid_user_id",
      +  "invalid_site",
      +  "invalid_parameter",
      +  "quota_exceeded"
      +]
    • addedOutput schema / properties / lastAccessDate
      Added value: +{
      +  "description": "ISO 8601 timestamp of the last time the user accessed the site — a stale value means the author is unlikely to respond.",
      +  "type": "string"
      +}
  3. Changed6 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "userId",
      +      "displayName",
      +      "link",
      +      "reputation",
      +      "topTags",
      +      "quotaRemaining",
      +      "quotaMax"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / error
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Present when the call failed. Absent on success.",
      +  "properties": {
      +    "code": {
      +      "description": "JSON-RPC error code for this failure.",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "data": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "reason": {
      +          "description": "Machine-readable failure mode. Declared by this tool: `user_not_found`: The user lookup returns an empty result set — SE returns HTTP 200 with no items for unknown user IDs rather than 404. `invalid_site`: The provided site value is not a valid Stack Exchange network site identifier. `quota_exceeded`: The Stack Exchange API quota_remaining has reached 0. Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "user_not_found",
      +            "invalid_site",
      +            "quota_exceeded"
      +          ],
      +          "type": "string"
      +        },
      +        "recovery": {
      +          "additionalProperties": {},
      +          "description": "Actionable next step for the caller.",
      +          "properties": {
      +            "hint": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "hint"
      +          ],
      +          "type": "object"
      +        },
      +        "retryable": {
      +          "description": "Whether retrying may succeed.",
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "message": {
      +      "description": "Human-readable description of what went wrong.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "code",
      +    "message"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "userId",
      -  "displayName",
      -  "link",
      -  "reputation",
      -  "topTags",
      -  "quotaRemaining",
      -  "quotaMax"
      -]
  4. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, so the safety profile is covered. The description adds a meaningful behavioral boundary: it returns up to 10 top tags by answer score, which is a useful constraint beyond the schema. Rate limits and auth are not discussed, but they are less critical for a read-only profile fetch.

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 three sentences and front-loaded with the core action. The second sentence earns its place by stating the calling context and parameter source. The third sentence is slightly redundant with the first sentence's field list, but it is short and clarifies the 10-tag limit.

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

Completeness5/5

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

For a two-parameter, read-only, idempotent tool with an output schema, this description is complete: it states what the tool returns, when to use it, and exactly where to get the required ID. Nothing an agent needs in order to select and invoke the tool correctly is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is already strong. The description adds semantic value by linking the userId parameter to a concrete source field, authorUserId from stackexchange_get_thread output, which helps an agent know how to populate the required parameter correctly. The site parameter is adequately documented in the schema.

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 opens with a specific verb-resource pair, 'Fetch a Stack Exchange user profile by numeric user ID,' and enumerates the returned fields (reputation, badge counts, question/answer counts, dates, top tags). This clearly distinguishes the tool from siblings like stackexchange_get_thread and stackexchange_search_questions.

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?

The description gives a concrete trigger: 'Useful for credibility context on an answer author,' and tells the agent exactly where to source the required ID ('pass the authorUserId from any question or answer in stackexchange_get_thread output'). It does not spell out when not to use it or name alternatives, but the intended use case is explicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.