Skip to main content
Glama
zouyingcao

AgentSkills MCP

by zouyingcao

load_skill

Load skill instructions from documentation to enable financial research agents to perform tasks like stock analysis, web scraping, and multi-source searches.

Instructions

Load one skill's instructions from the SKILL.md.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
skill_nameYesskill name

Implementation Reference

  • The `async_execute` method of `LoadSkillOp` class implements the core logic of the "load_skill" tool. It retrieves the skill directory, constructs the path to SKILL.md for the given skill_name, reads the file content if it exists, and sets it as output. If not found, sets an error message.
    async def async_execute(self):
        """Execute the load skill operation.
    
        Loads the SKILL.md file content for the specified skill name. The
        method retrieves the skill directory from the context's skill metadata
        dictionary, reads the SKILL.md file, and extracts the instructions
        content (excluding YAML frontmatter if present).
    
        The method:
        1. Extracts the skill_name from input_dict
        2. Looks up the skill directory from skill_metadata_dict
        3. Constructs the path to SKILL.md file
        4. Checks if the file exists
        5. Reads the file content
        6. Splits content by "---" to detect YAML frontmatter
        7. Returns content after frontmatter if present, otherwise full content
    
        Returns:
            None: The result is set via `self.set_output()` with one of:
                - The skill instructions (content after YAML frontmatter)
                - The full file content (if no frontmatter is found)
                - An error message string (if skill 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 LoadSkillOp.
    
        Note:
            - If the file has YAML frontmatter (format: "---\n...\n---\n..."),
              only the content after the second "---" is returned
            - If no frontmatter is detected, the entire file content is returned
            - File encoding is assumed to be UTF-8
        """
        # Extract skill name from input parameters
        skill_name = self.input_dict["skill_name"]
        # Look up the skill directory from the metadata dictionary
        # This dictionary should be populated by LoadSkillMetadataOp
        # 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: load_skill(skill_name='{skill_name}') with skill_dir={skill_dir}")
    
        # Construct the path to the SKILL.md file
        skill_path = skill_dir / skill_name / "SKILL.md"
    
        # Check if the SKILL.md file exists
        if not skill_path.exists():
            content = f"❌ Skill '{skill_name}' not found"
            logger.exception(content)
            self.set_output(content)
            return
    
        # Read the SKILL.md file content
        content: str = skill_path.read_text(encoding="utf-8")
        self.set_output(content)
    
        logger.info(f"✅ Loaded skill: {skill_name} size={len(content)}")
  • The `build_tool_call` method defines the tool schema for "load_skill", including the name, description, and input schema requiring a 'skill_name' string parameter.
    def build_tool_call(self) -> ToolCall:
        """Build the tool call definition for load_skill.
    
        Creates and returns a ToolCall object that defines the load_skill
        tool. This tool requires a skill_name parameter to identify which
        skill's instructions to load.
    
        Returns:
            ToolCall: A ToolCall object defining the load_skill tool with
                the following properties:
                - name: "load_skill"
                - description: Description of what the tool does
                - input_schema: A schema requiring a "skill_name" string
                    parameter that must be provided
        """
        return ToolCall(
            **{
                "name": "load_skill",
                "description": "Load one skill's instructions from the SKILL.md.",
                "input_schema": {
                    "skill_name": {
                        "type": "string",
                        "description": "skill name",
                        "required": True,
                    },
                },
            },
        )
  • The `LoadSkillOp` class is registered as an MCP operation using the `@C.register_op()` decorator, making the "load_skill" tool available via the MCP server.
    @C.register_op()
    class LoadSkillOp(BaseAsyncToolOp):
        """Operation for loading a specific skill's instructions.
    
        This tool loads the content of a SKILL.md file for a given skill name.
        The skill directory is retrieved from the context's skill_metadata_dict,
        which should be populated by LoadSkillMetadataOp beforehand.
    
        The tool:
        1. Takes a skill_name as input
        2. Looks up the skill directory from skill_metadata_dict
        3. Reads the SKILL.md file from that directory
        4. If YAML frontmatter is present, returns only the content after it
        5. If no frontmatter is found, returns the full file content
    
        Returns:
            str: The skill instructions content. If the SKILL.md file has YAML
                frontmatter (delimited by "---"), returns only the content after
                the frontmatter. Otherwise, returns the complete file content.
                If the skill is not found, returns an error message string.
    
        Note:
            - The skill_name must exist in `self.context.skill_metadata_dict`
            - The SKILL.md file must exist in the skill directory
            - YAML frontmatter is detected by splitting on "---" delimiters
        """
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 loads instructions but doesn't disclose behavioral traits like error handling (e.g., what happens if the skill doesn't exist), file format expectations, or whether it's a read-only operation. This leaves significant gaps in understanding how the tool behaves beyond its basic function.

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, clear sentence with zero waste, efficiently conveying the core action and resource. It is appropriately sized and front-loaded, making it easy to understand at a glance.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what the loaded instructions look like (e.g., text content, structure), error scenarios, or dependencies. For a tool that likely returns instructional data, more context is needed to guide effective use.

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% description coverage, with the single parameter 'skill_name' documented as 'skill name'. The description adds no additional meaning beyond this, such as format constraints or examples. Since the schema does the heavy lifting, the baseline score of 3 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 ('Load') and resource ('one skill's instructions from the SKILL.md'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'load_skill_metadata' or 'read_reference_file', which likely handle related but different operations.

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 such as 'load_skill_metadata' (which might load metadata instead of instructions) or 'read_reference_file' (which might read other files). The description implies usage for loading skill instructions but lacks explicit context or exclusions.

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