Skip to main content
Glama
juhemcp

Juhe News MCP Server

Official
by juhemcp

get_news_content

Retrieve the full content and details of a news article by passing its unique identifier. Access the article body, source, and other metadata.

Instructions

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

Input Schema

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

Implementation Reference

  • Handler function that fetches detailed news content from the Juhe API using a uniquekey. Calls JUHE_NEWS_API_BASE/content endpoint and returns the result as text content.
    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']}"
                    )
                ]
  • Schema definition for the get_news_content tool, specifying the input schema with a required 'uniquekey' string parameter.
    types.Tool(
        name="get_news_content",
        description="根据新闻ID获取新闻的详细内容",
        inputSchema={
            "type": "object",
            "properties": {
                "uniquekey": {"type": "string", "description": "新闻ID(gew_news_list中返回的uniquekey)"},  
            },
            "required": ["uniquekey"],
        },
    ),
  • Registration of the tool in the call_tool handler: dispatches 'get_news_content' requests to the actual handler function.
    elif name == "get_news_content":
        uniquekey = arguments.get("uniquekey") if arguments else None
        if not uniquekey:
            raise ValueError("Missing name or content")
        return await get_news_content(uniquekey)
Behavior2/5

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

No annotations are provided, and the description lacks details about behavioral traits such as read-only nature, authentication requirements, error handling, or response format. It only implies a read operation through the verb 'get'.

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 extremely concise (one sentence) and directly conveys the core purpose. It is front-loaded and wastes no words, though it could include more context without sacrificing brevity.

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

Completeness3/5

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

For a simple retrieval tool with one parameter and no output schema, the description is adequate but not complete. It does not specify the structure or scope of the detailed content, nor any edge cases like missing IDs.

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 input schema has 100% coverage with a clear description for the only parameter. The tool description adds no additional meaning beyond what the schema already provides, so baseline score is appropriate.

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 action (获取/get) and resource (新闻详细内容/detailed news content) with a specific identifier (by news ID). It distinguishes from the sibling tool get_news_list, which likely returns a list, by specifying 'detailed content'.

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

Usage Guidelines3/5

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

The description does not explicitly state when to use or not use this tool, but it indicates the prerequisite by mentioning the origin of the uniquekey (from get_news_list), providing implicit context for usage.

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