Skip to main content
Glama

获取题目详情

nowcoder_get_problem
Read-onlyIdempotent

Fetches full details of a specific Nowcoder programming problem by ID, including statement, input/output format, examples, and limits.

Instructions

获取牛客网特定编程题目的完整描述,包括题面、输入输出格式、示例和限制。

Args:

  • problemId (string): 题目ID

  • response_format (string): 输出格式 - "markdown"(默认) 或 "json"

Returns: 题目详情,包含标题、时间/内存限制、题目描述

Examples:

  • 获取题目: { "problemId": "1001" }

  • JSON格式: { "problemId": "1001", "response_format": "json" }

Error Handling:

  • 题目不存在时返回错误提示

  • 页面加载超时时返回超时提示

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
problemIdYes题目ID,例如 '1001'
response_formatNo输出格式: 'markdown' 人类可读, 'json' 机器可解析markdown

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description goes beyond them by disclosing failure behavior: an error message when the problem does not exist and a timeout message when the page fails to load, which is genuinely useful operational context.

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?

Purpose is front-loaded in the first sentence, then structured into Args/Returns/Examples/Error Handling sections that are easy to scan. The Examples block is somewhat redundant with the schema, costing a little density, but nothing is padded or vague.

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?

With no output schema, the description must describe the return payload, and it does (标题、时间/内存限制、题目描述), which matches the stated purpose. Failure modes are also covered. It stops short of describing pagination or content-length limits, which is a minor gap for a single-item fetch.

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%, and the schema already documents problemId's format and the markdown/json enum with defaults. The Args section mostly restates this, adding only the 'markdown is default' note that the schema default already encodes. Baseline 3 is correct since the schema does the heavy lifting.

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 states a specific verb and resource (获取牛客网特定编程题目的完整描述) and enumerates what the payload contains (题面、输入输出格式、示例和限制). It implicitly distinguishes itself from list/search siblings by being a single-problem fetch keyed on problemId, but it never names those siblings explicitly.

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?

There is no when-to-use guidance relative to alternatives such as nowcoder_search or nowcoder_list_problems, and no stated prerequisite for how a problemId is obtained. The Examples block shows invocation syntax rather than selection guidance, so an agent must infer when this tool is the right choice.

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