Skip to main content
Glama
parsiya

Trailmark MCP Server

by parsiya

current_repository

Retrieve metadata for the active repository session, including session ID and related details.

Instructions

Return metadata for the active repository session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler that delegates to TrailmarkRuntime.current_repository(). This is the entry point registered with the FastMCP server via @mcp.tool().
    @mcp.tool()
    def current_repository(session_id: str | None = None) -> dict[str, Any]:
        """Return metadata for the active repository session."""
        return app_runtime.current_repository(session_id=session_id)
  • Runtime layer: retrieves the EngineHandle from the registry and converts it to a dict via _handle_to_dict().
    def current_repository(self, session_id: str | None = None) -> dict[str, Any]:
        return self._handle_to_dict(self.registry.current_repository(session_id))
  • Core business logic: looks up the EngineHandle by session_id (or default session). Raises ValueError if no session is active.
    def current_repository(self, session_id: str | None = None) -> EngineHandle:
        handle = self.get(session_id)
        if handle is None:
            raise ValueError("No active repository session")
        return handle
  • Tool schema definition specifying name, category, description, and parameters (optional session_id) for the 'current_repository' tool.
    ToolSpec(
        name="current_repository",
        category="lifecycle",
        description="Return the active repository session and latest snapshot metadata.",
        parameters={"session_id": SESSION_ID_PARAM},
    ),
  • Helper that serializes EngineHandle dataclass fields into a dictionary response (session_id, repo_path, language, timestamps, etc.).
    def _handle_to_dict(self, handle: EngineHandle) -> dict[str, Any]:
        return {
            "session_id": handle.session_id,
            "repo_path": str(handle.repo_path),
            "language": handle.language,
            "created_at": handle.created_at.isoformat().replace("+00:00", "Z") if handle.created_at else None,
            "last_scan_at": handle.last_scan_at.isoformat().replace("+00:00", "Z") if handle.last_scan_at else None,
            "preanalysis_ran": handle.preanalysis_ran,
            "applied_augmentations": list(handle.applied_augmentations),
            "last_snapshot_path": str(handle.last_snapshot_path) if handle.last_snapshot_path else None,
            "snapshot_metadata": handle.snapshot_metadata,
        }
Behavior2/5

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

No annotations provided, so description carries full burden. Does not disclose side effects, required permissions, or what 'metadata' includes.

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?

Single sentence, front-loaded with action. Concise but lacks detail.

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?

Even with an output schema, the description should clarify the role of 'session_id' and what constitutes 'active session'. Missing context reduces completeness.

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

Parameters1/5

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

Schema description coverage is 0%. The description adds no meaning about the 'session_id' parameter beyond what the schema provides.

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?

Description clearly states the tool returns metadata for the active repository session, distinguishing it from sibling tools like 'close_repository' or 'graph_summary'.

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 on when to use this tool vs alternatives. Does not mention prerequisites 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/parsiya/trailmark-mcp-server'

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