Skip to main content
Glama
leejersey

Hexo Blog MCP Server

by leejersey

backup_source

Backup Hexo blog source code to a dedicated Git branch for version control and safe storage.

Instructions

将博客源码通过 Git 备份到 hexo-source 分支

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageNo可选的 Git 提交信息

Implementation Reference

  • The core implementation logic for backing up the source code via git add, commit, and push.
    export async function backupSource(message?: string): Promise<string> {
        const commitMsg = message || `Auto backup: ${new Date().toISOString()}`;
    
        await runCommand("git add .");
    
        try {
            await runCommand(`git commit -m "${commitMsg}"`);
        } catch (e: any) {
            if (e.message?.includes("nothing to commit")) {
                return "没有需要提交的更改。";
            }
            throw e;
        }
    
        await runCommand(`git push origin ${GIT_BRANCH}`);
        return `源码已备份到 ${GIT_BRANCH} 分支。提交信息: ${commitMsg}`;
    }
  • Registration of the 'backup_source' tool using MCP server, which calls the backupSource handler.
    server.tool(
        "backup_source",
        "将博客源码通过 Git 备份到 hexo-source 分支",
        {
            message: z.string().optional().describe("可选的 Git 提交信息"),
        },
        async ({ message }) => {
            try {
                const result = await backupSource(message);
                return {
                    content: [{ type: "text" as const, text: `✅ ${result}` }],
                };
            } 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 the action ('backup via Git') but lacks critical details: whether this requires specific permissions, if it's idempotent, what happens on failure, or what the output looks like. For a mutation tool (implied by 'backup' as a write operation), this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Chinese that clearly states the tool's purpose. It's front-loaded with the core action and includes specific implementation details without unnecessary elaboration. Every word earns its place, making it highly concise and well-structured.

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 complexity (a Git backup operation with potential side effects), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'backup' entails (e.g., commit, push), success/failure behavior, or return values. For a tool that modifies repository state, this leaves the agent with insufficient context to use it reliably.

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% for the single parameter 'message', which is documented as 'optional Git commit message'. The description adds no parameter information beyond what the schema provides. With high schema coverage and only one parameter, the baseline score of 3 is appropriate—the description doesn't add value but doesn't need to compensate for gaps.

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 ('backup') and resource ('blog source code') with specific implementation details ('via Git to hexo-source branch'). It distinguishes from siblings like 'deploy_blog' or 'git_status' by focusing on backup rather than deployment or status checking. However, it doesn't explicitly contrast with all siblings, missing some differentiation opportunities.

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 on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., Git repository setup), timing (e.g., after content changes), or when not to use it (e.g., versus 'deploy_blog' for publishing). This leaves the agent without context for tool selection among the 11 siblings.

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