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")'),
        },
      },

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