Skip to main content
Glama
parsiya

Trailmark MCP Server

by parsiya

run_preanalysis

Analyze code repositories by running Trailmark preanalysis on the active engine. Optionally specify a session ID for targeted analysis.

Instructions

Run Trailmark preanalysis on the active engine.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'run_preanalysis' — registered via @mcp.tool() decorator, delegates to app_runtime.run_preanalysis()
    @mcp.tool()
    def run_preanalysis(session_id: str | None = None) -> dict[str, Any]:
        """Run Trailmark preanalysis on the active engine."""
        return app_runtime.run_preanalysis(session_id=session_id)
  • Core logic of run_preanalysis: gets the scanned handle, calls engine.preanalysis(), marks preanalysis_ran=True, returns the result
    def run_preanalysis(self, session_id: str | None = None) -> dict[str, Any]:
        handle = self._require_scanned_handle(session_id)
        result = handle.engine.preanalysis()
        handle.preanalysis_ran = True
        return result
  • ToolSpec registration for 'run_preanalysis' with category 'mutation', description, and session_id parameter
    ToolSpec(
        name="run_preanalysis",
        category="mutation",
        description="Run Trailmark preanalysis on the active engine.",
        parameters={"session_id": SESSION_ID_PARAM},
    ),
  • Internal _scan_handle that also invokes preanalysis during scan when run_preanalysis=True
    def _scan_handle(
        self,
        handle: EngineHandle,
        *,
        language: str | None = None,
        run_preanalysis: bool = True,
    ) -> dict[str, Any]:
        if language is not None:
            handle.language = language
        handle.engine = QueryEngine.from_directory(str(handle.repo_path), language=handle.language)
        handle.last_scan_at = datetime.now(UTC)
        handle.preanalysis_ran = False
        handle.applied_augmentations.clear()
        preanalysis_summary: dict[str, Any] | None = None
        if run_preanalysis:
            preanalysis_summary = handle.engine.preanalysis()
            handle.preanalysis_ran = True
        return {
            "session": self._handle_to_dict(handle),
            "summary": handle.engine.summary(),
            "preanalysis": preanalysis_summary,
        }
  • open_repository tool handler passes run_preanalysis parameter to app_runtime.open_repository, which can trigger preanalysis during scan
    def open_repository(
        repo_path: str,
        language: str = "auto",
        rescan: bool = False,
        run_preanalysis: bool = True,
    ) -> dict[str, Any]:
        """Open a repository, loading latest snapshot or scanning source as needed."""
        return app_runtime.open_repository(
            repo_path,
            language=language,
            rescan=rescan,
            run_preanalysis=run_preanalysis,
        )
Behavior1/5

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

No annotations provided, and the description fails to disclose any behavioral traits (e.g., side effects, permissions, state changes). The agent is left without essential safety information.

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

Conciseness2/5

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

The description is a single sentence, which is concise, but it lacks the necessary detail to be effective. Under-specification is not true conciseness.

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

Completeness1/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 is incomplete. It provides no information about output, return values, or the overall context of the tool's operation.

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%, and the description does not mention the 'session_id' parameter. It adds no meaning beyond the schema's definition.

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

Purpose3/5

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

The description 'Run Trailmark preanalysis on the active engine' identifies the action and resource, but 'Trailmark preanalysis' is vague and does not distinguish this tool from siblings like 'findings' or 'subgraph'.

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 versus alternatives, nor any prerequisites or context. The description lacks explicit usage boundaries.

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