Skip to main content
Glama
juhemcp

Juhe News MCP Server

Official
by juhemcp

get_news_content

Retrieve detailed news content by providing a news ID, enabling access to full articles from the Juhe News MCP Server.

Instructions

根据新闻ID获取新闻的详细内容

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uniquekeyYes新闻ID(gew_news_list中返回的uniquekey)

Implementation Reference

  • The implementation of the get_news_content tool handler. It makes an HTTP GET request to the Juhe news API endpoint '/content' with the uniquekey and API key, parses the JSON response, and returns the news content as TextContent or an error message.
    async def get_news_content(uniquekey: str) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
        """
        根据新闻ID(uniquekey)获取新闻的详细内容.
        """
        url = f"{JUHE_NEWS_API_BASE}/content"
        params = {
            "uniquekey": uniquekey,
            "key": JUHE_NEWS_API_KEY
        }
        async with httpx.AsyncClient() as client:
            response = await client.get(url, params=params)
            data = response.json()
            if data["error_code"] == 0:
                news_content = data["result"]
                return [
                    # types.TextContent(
                    #     type="text",
                    #     text=f"""
                    #     标题: {news_content['title']}
                    #     作者: {news_content['author_name']}
                    #     URL: {news_content['url']}
                    #     新闻id: {news_content['uniquekey']}
                    #     新闻内容: {news_content['content']}
                    #     """
                    # )
                    types.TextContent(
                        type="text",
                        text=f"{news_content}"
                    )
                ]
            else:
                return [
                    types.TextContent(
                        type="text",
                        text=f"Error: {data['reason']}"
                    )
                ]
  • The JSON Schema for the input parameters of the get_news_content tool, defining 'uniquekey' as a required string.
    inputSchema={
        "type": "object",
        "properties": {
            "uniquekey": {"type": "string", "description": "新闻ID(gew_news_list中返回的uniquekey)"},  
        },
        "required": ["uniquekey"],
    },
  • The tool registration in the list_tools() handler, specifying name, description, and input schema for get_news_content.
    types.Tool(
        name="get_news_content",
        description="根据新闻ID获取新闻的详细内容",
        inputSchema={
            "type": "object",
            "properties": {
                "uniquekey": {"type": "string", "description": "新闻ID(gew_news_list中返回的uniquekey)"},  
            },
            "required": ["uniquekey"],
        },
    ),
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves detailed content but does not mention whether it's a read-only operation, requires authentication, has rate limits, or what the output format might be. This leaves significant gaps in understanding the tool's behavior beyond basic functionality.

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 a single, clear sentence that efficiently conveys the core purpose without unnecessary words. It is front-loaded with the main action, making it easy to understand quickly, though it could benefit from slightly more detail to improve completeness without sacrificing brevity.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It covers the basic purpose and parameter but fails to address behavioral aspects like safety, response format, or error handling. For a tool with no structured metadata, more descriptive context is needed to fully inform an AI agent.

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?

The schema description coverage is 100%, with the parameter 'uniquekey' fully documented in the schema as a required string from 'gew_news_list'. The description adds minimal value by restating that it uses a news ID, but does not provide additional context or semantics beyond what the schema already covers, aligning with the baseline for high schema coverage.

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 clearly states the verb ('获取' meaning 'get') and resource ('新闻的详细内容' meaning 'detailed content of news'), specifying it retrieves detailed content based on a news ID. However, it does not explicitly differentiate from the sibling tool 'get_news_list', which likely lists news items rather than fetching detailed content, leaving some ambiguity in sibling distinction.

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?

The description provides no guidance on when to use this tool versus alternatives, such as the sibling 'get_news_list'. It mentions the parameter 'uniquekey' comes from 'gew_news_list', implying a prerequisite but not stating when to choose this tool over others or any exclusions, resulting in minimal usage context.

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

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/juhemcp/jnews-mcp-server'

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