Skip to main content
Glama

twining_trace

Trace decision dependencies upstream to identify prerequisites or downstream to see impacts. Maps relationships in development workflows using BFS with cycle protection.

Instructions

Trace a decision's dependency chain upstream (what it depends on) and/or downstream (what depends on it). Uses BFS with cycle protection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
decision_idYesID of the decision to trace
directionNoDirection to trace (default: "both")

Implementation Reference

  • The MCP tool handler for "twining_trace" which calls the engine's trace method and handles errors.
    async (args) => {
      try {
        const result = await engine.trace(args.decision_id, args.direction);
        return toolResult(result);
      } catch (e) {
        if (e instanceof TwiningError) {
          return toolError(e.message, e.code);
        }
        return toolError(
          e instanceof Error ? e.message : "Unknown error",
          "INTERNAL_ERROR",
        );
  • The core implementation of the trace logic within the decision engine.
    async trace(
      decisionId: string,
      direction: "upstream" | "downstream" | "both" = "both",
    ): Promise<{ chain: TraceEntry[] }> {
  • Registration of the "twining_trace" tool including its input schema and description.
    server.registerTool(
      "twining_trace",
      {
        description:
          "Trace a decision's dependency chain upstream (what it depends on) and/or downstream (what depends on it). Uses BFS with cycle protection.",
        inputSchema: {
          decision_id: z.string().describe("ID of the decision to trace"),
          direction: z
            .enum(["upstream", "downstream", "both"])
            .optional()
            .describe('Direction to trace (default: "both")'),
        },
      },
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the algorithm (BFS with cycle protection), which adds valuable behavioral context beyond basic functionality. However, it omits details like performance characteristics, error handling, or output format, leaving gaps in transparency.

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, efficient sentence with zero wasted words. It is front-loaded with the core purpose and includes essential technical details (BFS, cycle protection) without unnecessary elaboration.

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?

For a tool with no annotations and no output schema, the description is moderately complete. It covers the core behavior but lacks details on output structure, error conditions, or integration with sibling tools. Given the complexity, it should provide more context to fully guide the agent.

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?

Schema description coverage is 100%, so the schema fully documents both parameters. The description adds no additional parameter semantics beyond what the schema provides, such as examples or edge cases. Baseline 3 is appropriate given the high schema coverage.

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 clearly states the specific action ('Trace a decision's dependency chain') and distinguishes it from siblings by specifying the scope (upstream/downstream) and method (BFS with cycle protection). It uses precise verbs and resources, making the purpose unambiguous.

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?

The description provides no guidance on when to use this tool versus alternatives like 'twining_neighbors' or 'twining_graph_query'. It lacks context about prerequisites, exclusions, or typical use cases, leaving the agent with minimal usage direction.

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/daveangulo/twining-mcp'

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