Skip to main content
Glama
thana0623

prompts-mcp-server

by thana0623

read_module

Retrieve the modification history of a given module to review past changes before making updates.

Instructions

【读取模块记录】修改功能前调用,读取对应模块的历史修改记录。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
moduleNameYes模块名称

Implementation Reference

  • Handler function for the 'read_module' tool. Extracts moduleName from args, gets project root, calls readModuleLog, and returns the content.
    private async handleReadModule(args: any) {
      const moduleName = typeof args?.moduleName === 'string' ? args.moduleName : '';
    
      if (!moduleName) {
        return {
          content: [{ type: 'text', text: '❌ "moduleName" 是必填参数。' }],
          isError: true,
        };
      }
    
      const projectRoot = getProjectRoot();
      const content = readModuleLog(projectRoot, moduleName);
    
      return {
        content: [{ type: 'text', text: `# 模块记录: ${moduleName}\n\n${content}` }],
      };
    }
  • Core helper function that reads the module log file from .github/prompts/modules/<moduleName>.md. Returns file contents or a default 'no records' / 'read failed' message.
    export function readModuleLog(projectRoot: string, moduleName: string): string {
      const filePath = getModulePath(projectRoot, moduleName);
      try {
        if (fs.existsSync(filePath)) {
          return fs.readFileSync(filePath, 'utf-8');
        }
        return `# 模块记录: ${moduleName}\n\n*暂无记录*\n`;
      } catch {
        return `# 模块记录: ${moduleName}\n\n*读取失败*\n`;
      }
    }
  • Input schema for read_module tool. Requires 'moduleName' (string) as the only parameter.
    {
      name: 'read_module',
      description: '【读取模块记录】修改功能前调用,读取对应模块的历史修改记录。',
      inputSchema: {
        type: 'object',
        properties: {
          moduleName: {
            type: 'string',
            description: '模块名称',
          },
        },
        required: ['moduleName'],
      },
    },
  • src/index.ts:250-251 (registration)
    Routes the 'read_module' tool name to handleReadModule in the CallToolRequestSchema handler.
    case 'read_module':
      return this.handleReadModule(args);
  • src/index.ts:198-211 (registration)
    Tool definition registered in ListToolsRequestSchema with name 'read_module' and its input schema.
    {
      name: 'read_module',
      description: '【读取模块记录】修改功能前调用,读取对应模块的历史修改记录。',
      inputSchema: {
        type: 'object',
        properties: {
          moduleName: {
            type: 'string',
            description: '模块名称',
          },
        },
        required: ['moduleName'],
      },
    },
Behavior3/5

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

No annotations are provided, so the description must disclose behavior. It indicates a read operation with no side effects, which is appropriate for a read tool. It does not mention authorization, rate limits, or output details, but the read nature is clear.

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 very concise, consisting of a single sentence that effectively communicates the purpose and timing. It is well-structured and front-loaded with the key action.

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?

Given the simplicity (one required parameter, no output schema), the description covers the basic purpose and usage context. However, it lacks details on the output format or how to interpret the results, which could be important for an agent selecting the tool.

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 already provides a description for the single parameter ('module name') with 100% coverage. The description does not add extra meaning beyond 'the corresponding module', so it meets the baseline but does not enhance understanding.

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 that the tool reads historical modification records of a module and is called before modification, distinguishing it from siblings like 'log_module' which likely logs new records rather than reading history.

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 specifies that the tool is used before modifying a function, providing usage context. However, no alternatives or when-not-to-use guidance are given, and there is no explicit differentiation from sibling tools like 'log_module'.

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/thana0623/prompts-mcp-server'

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