Skip to main content
Glama
parsiya

Trailmark MCP Server

by parsiya

close_repository

Terminates an active repository session to free resources. Provide a session ID to close a specific session.

Instructions

Close an active repository session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core registry method that removes a session from the session dict and updates the default session pointer.
    def close_repository(self, session_id: str | None = None) -> bool:
        handle = self.get(session_id)
        if handle is None:
            return False
        del self._sessions[handle.session_id]
        if self._default_session_id == handle.session_id:
            self._default_session_id = next(reversed(self._sessions), None) if self._sessions else None
        return True
  • Runtime wrapper that retrieves the handle, delegates to registry.close_repository, and returns a dict with closed status.
    def close_repository(self, session_id: str | None = None) -> dict[str, Any]:
        handle = self.registry.get(session_id)
        if handle is None:
            return {"closed": False}
        closed = self.registry.close_repository(session_id)
        return {
            "closed": closed,
            "session_id": handle.session_id,
            "repo_path": str(handle.repo_path),
        }
  • MCP tool handler decorated with @mcp.tool() -- the actual entry point called by the MCP framework for the close_repository tool.
    def close_repository(session_id: str | None = None) -> dict[str, Any]:
        """Close an active repository session."""
        return app_runtime.close_repository(session_id=session_id)
  • Tool specification (schema) defining the close_repository tool metadata and its session_id parameter.
    ToolSpec(
        name="close_repository",
        category="lifecycle",
        description="Close the active repository session.",
        parameters={"session_id": SESSION_ID_PARAM},
    ),
  • The @mcp.tool() decorator registers close_repository as an MCP tool on the FastMCP server.
    @mcp.tool()
    def close_repository(session_id: str | None = None) -> dict[str, Any]:
        """Close an active repository session."""
        return app_runtime.close_repository(session_id=session_id)
Behavior2/5

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

No annotations provided; description only states 'close an active repository session' without disclosing side effects, unsaved state handling, or impact on other tools.

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

Conciseness3/5

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

The description is very short and front-loaded, but lacks essential details like return value or parameter format.

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?

Despite having an output schema, the description does not explain return values or confirm successful closure, leaving some contextual gaps.

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

Parameters2/5

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

Schema description coverage is 0%; description adds no meaning beyond the parameter name 'session_id', leaving the agent to infer its purpose.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the action 'close' and resource 'active repository session', clearly distinguishing from siblings like open_repository.

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 implies usage when a session needs to be closed, but offers no explicit guidance on when to use vs alternatives or prerequisites.

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/parsiya/trailmark-mcp-server'

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