Skip to main content
Glama

Refresh Library

refresh_library
Read-onlyIdempotent

Update the Mode Manager MCP library from its source URL to ensure access to current chat modes and instructions.

Instructions

Refresh the Mode Manager MCP Library from its source URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'refresh_library' tool. It invokes the library manager's refresh method and formats a user-friendly response string including library details.
    def refresh_library() -> str:
        """Refresh the Mode Manager MCP Library from its source URL."""
        try:
            result = library_manager.refresh_library()
            if result["status"] == "success":
                return (
                    f"{result['message']}\n\n"
                    f"Library: {result['library_name']} (v{result['version']})\n"
                    f"Last Updated: {result['last_updated']}\n"
                    f"Available: {result['total_chatmodes']} chatmodes, {result['total_instructions']} instructions\n\n"
                    f"Use browse_mode_library() to see the updated content."
                )
            else:
                return f"Refresh failed: {result.get('message', 'Unknown error')}"
        except FileOperationError as e:
            return f"Error refreshing library: {str(e)}"
        except Exception as e:
            return f"Unexpected error refreshing library: {str(e)}"
  • Supporting method in LibraryManager class that fetches the library JSON from the configured URL and returns metadata about it.
    def refresh_library(self) -> Dict[str, Any]:
        """
        Refresh the library by fetching the latest version from the URL.
    
        Note: Without caching, this method now just fetches the library like any other operation.
    
        Returns:
            Updated library information
        """
        try:
            library = self._fetch_library()
    
            return {
                "status": "success",
                "library_name": library.get("name", "Mode Manager MCP Library"),
                "version": library.get("version", "1.0.0"),
                "last_updated": library.get("last_updated", "Unknown"),
                "total_chatmodes": len(library.get("chatmodes", [])),
                "total_instructions": len(library.get("instructions", [])),
                "message": "Library refreshed successfully",
            }
    
        except Exception as e:
            raise FileOperationError(f"Error refreshing library: {str(e)}")
  • Tool registration decorator defining the name, description, tags, annotations, and metadata for the refresh_library tool.
    @app.tool(
        name="refresh_library",
        description="Refresh the Mode Manager MCP Library from its source URL.",
        tags={"public", "library"},
        annotations={
            "idempotentHint": True,
            "readOnlyHint": True,
            "title": "Refresh Library",
            "returns": "Returns information about the library refresh operation, including library name, version, last updated date, and counts of available chatmodes and instructions. Also provides usage instructions.",
        },
        meta={"category": "library"},
    )
  • Annotations providing schema hints for idempotency, read-only status, title, and return description for the tool.
    annotations={
        "idempotentHint": True,
        "readOnlyHint": True,
        "title": "Refresh Library",
        "returns": "Returns information about the library refresh operation, including library name, version, last updated date, and counts of available chatmodes and instructions. Also provides usage instructions.",
    },
Behavior3/5

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

Annotations already indicate readOnlyHint=true and idempotentHint=true, so the agent knows it's safe and repeatable. The description adds that it refreshes from a source URL, providing useful context beyond annotations, but doesn't detail side effects like network calls or performance impacts.

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 no wasted words, front-loading the key action and resource. It efficiently conveys the tool's purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 0 parameters, rich annotations (readOnlyHint, idempotentHint), and an output schema, the description is reasonably complete. It explains what the tool does, though it could benefit from more usage context or behavioral details to reach a 5.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0 parameters and 100% schema description coverage, the schema fully documents the absence of inputs. The description adds no parameter details, which is appropriate here, earning a baseline 4 for not needing to compensate.

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 ('Refresh') and the resource ('Mode Manager MCP Library'), specifying it's from a source URL. It distinguishes from siblings like 'browse_mode_library' or 'install_from_library' by focusing on updating rather than viewing or installing, though it doesn't explicitly name alternatives.

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 like 'update_chatmode_from_source' or 'install_from_library'. The description implies a refresh action but doesn't specify context, prerequisites, or exclusions, leaving usage unclear.

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/NiclasOlofsson/mode-manager-mcp'

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