Skip to main content
Glama
leejersey

Hexo Blog MCP Server

by leejersey

read_post

Retrieve complete Hexo blog post content including Front-matter and body text by specifying the filename. This tool enables AI clients to access and process full article data for blog management tasks.

Instructions

读取指定文章的完整内容(含 Front-matter 和正文)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes文章文件名,如 react-hooks笔记.md

Implementation Reference

  • The actual logic that reads the post content from the file system.
    export async function readPost(filename: string): Promise<PostFull> {
        const fullPath = postPath(filename);
        const raw = await fs.readFile(fullPath, "utf-8");
        const { data, content } = matter(raw);
    
        return {
            title: data.title || filename.replace(/\.md$/, ""),
            date: data.date ? String(data.date) : "未知",
            tags: Array.isArray(data.tags) ? data.tags : data.tags ? [data.tags] : [],
            filename,
            wordCount: content.length,
            content,
            rawContent: raw,
        };
    }
  • The tool registration for "read_post" and its MCP tool handler implementation.
    // 读取文章
    server.tool(
        "read_post",
        "读取指定文章的完整内容(含 Front-matter 和正文)",
        { filename: z.string().describe("文章文件名,如 react-hooks笔记.md") },
        async ({ filename }) => {
            try {
                const post = await readPost(filename);
                const header = `# ${post.title}\n日期: ${post.date}\n标签: ${post.tags.join(", ") || "无"}\n字数: ${post.wordCount}\n---\n`;
                return {
                    content: [{ type: "text" as const, text: header + post.content }],
                };
            } catch (e: any) {
                return { content: [{ type: "text" as const, text: `错误: ${e.message}` }], isError: true };
            }
        }
    );
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states what content is returned but doesn't mention error conditions (e.g., what happens if filename doesn't exist), permissions required, rate limits, or response format. For a read operation with zero annotation coverage, this leaves significant behavioral gaps.

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, efficient sentence that communicates the core purpose. It's appropriately sized for a simple read operation, though it could potentially be more front-loaded with key behavioral information given the lack of annotations.

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 single-parameter read tool with good schema coverage but no annotations and no output schema, the description is minimally adequate. It states what content is retrieved but doesn't address error handling, return format, or how this differs from similar tools. The description meets basic requirements but leaves the agent to infer important contextual details.

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% with one parameter clearly documented. The description doesn't add any parameter semantics beyond what the schema provides - it mentions '指定文章' (specified article) which aligns with the filename parameter but adds no additional context about format, constraints, or examples. Baseline 3 is appropriate when 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 clearly states the action ('读取' - read) and resource ('指定文章的完整内容' - complete content of specified article), including what content is retrieved (Front-matter and body text). It doesn't explicitly differentiate from sibling tools like 'list_posts' or 'search_posts', but the focus on reading full content of a specific article is reasonably clear.

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?

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention prerequisites, when not to use it, or how it differs from sibling tools like 'preview_blog' or 'search_posts'. The agent must infer usage context from the tool name and description alone.

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/leejersey/hexo-mcp-server'

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