Skip to main content
Glama
zouyingcao

AgentSkills MCP

by zouyingcao

read_reference_file

Access reference documentation for financial research skills by reading files containing forms, specifications, or technical guides to support analysis tasks.

Instructions

Read a reference file from a skill (e.g., forms.md, reference.md, ooxml.md)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
skill_nameYesskill name
file_nameYesreference file name or file path

Implementation Reference

  • The async_execute method that performs the core logic of the read_reference_file tool: retrieves parameters, locates the skill directory, constructs and reads the file path, handles missing files.
    async def async_execute(self):
        """Execute the read reference file operation.
    
        Reads a reference file from the specified skill directory. The method
        retrieves the skill directory from the context's skill metadata
        dictionary, constructs the file path, and reads the file content if it
        exists.
    
        The method:
        1. Extracts the skill_name and file_name from input_dict
        2. Looks up the skill directory from skill_metadata_dict
        3. Constructs the file path as {skill_dir}/{file_name}
        4. Checks if the file exists
        5. Reads the file content if it exists
        6. Returns the file content or an error message if not found
    
        Returns:
            None: The result is set via `self.set_output()` with one of:
                - The file content (as a string) if the file exists
                - An error message string if the file is not found
    
        Raises:
            KeyError: If skill_name is not found in skill_metadata_dict.
                This should be handled by ensuring LoadSkillMetadataOp is
                called before ReadReferenceFileOp.
    
        Note:
            - The file path is constructed as: {skill_dir}/{file_name}
            - File encoding is assumed to be UTF-8
            - If the file does not exist, an error message is returned instead
              of raising an exception
        """
        skill_name = self.input_dict["skill_name"]
        file_name = self.input_dict["file_name"]
        # skill_dir = Path(self.context.skill_metadata_dict[skill_name]["skill_dir"])
        skill_dir = Path(C.service_config.metadata["skill_dir"]) ###
        logger.info(
            f"🔧 Tool called: read_reference_file(skill_name='{skill_name}', file_name='{file_name}') "
            f"with skill_dir={skill_dir}",
        )
    
        file_path = skill_dir / skill_name / file_name ###
        if not file_path.exists():
            content = f"File '{file_name}' not found in skill '{skill_name}'"
            logger.exception(content)
            self.set_output(content)
            return
    
        result = file_path.read_text(encoding="utf-8")
        logger.info(f"✅ Read file: {skill_name}/{file_name} size={len(result)}")
        self.set_output(result)
  • The build_tool_call method returns the ToolCall definition including the tool name 'read_reference_file' and its input schema requiring 'skill_name' and 'file_name'.
    return ToolCall(
        **{
            "name": "read_reference_file",
            "description": "Read a reference file from a skill (e.g., forms.md, reference.md, ooxml.md)",
            "input_schema": {
                "skill_name": {
                    "type": "string",
                    "description": "skill name",
                    "required": True,
                },
                "file_name": {
                    "type": "string",
                    "description": "reference file name or file path",
                    "required": True,
                },
            },
        },
    )
  • The ReadReferenceFileOp class is registered as an operation using the @C.register_op() decorator, making it available as the 'read_reference_file' tool.
    @C.register_op()
    class ReadReferenceFileOp(BaseAsyncToolOp):
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool reads files but doesn't disclose behavioral traits such as error handling (e.g., what happens if the file doesn't exist), permissions required, rate limits, or output format. This leaves significant gaps for a tool that interacts with file systems.

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 with no wasted words. It front-loads the core purpose and includes helpful examples, making it easy to parse quickly. Every element earns its place without redundancy.

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 no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., file content, error messages) or address potential complexities like file paths or skill dependencies. For a file-reading tool, this lack of behavioral and output context is a significant gap.

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%, so the schema already documents both parameters ('skill_name' and 'file_name'). The description adds minimal value by implying the file is from a skill context and providing examples (e.g., forms.md), but doesn't elaborate on parameter semantics beyond what the schema provides, meeting the baseline for high 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 action ('Read') and resource ('a reference file from a skill'), with examples provided. It distinguishes from sibling tools like 'load_skill' and 'load_skill_metadata' by focusing specifically on reading reference files rather than loading skills or metadata. However, it doesn't explicitly differentiate from 'run_shell_command', which might also read files.

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 like 'load_skill' or 'run_shell_command'. It mentions examples of reference files (e.g., forms.md) but doesn't specify scenarios or prerequisites for usage, leaving the agent to infer context from tool names 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/zouyingcao/agentskills-mcp'

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