Skip to main content
Glama

twining_commits

Trace code changes to decision rationale by querying decisions linked to specific Git commit hashes for development traceability.

Instructions

Query decisions by commit hash. Returns all decisions that were linked to a given commit, enabling traceability from code changes back to decision rationale.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commit_hashYesGit commit hash to look up

Implementation Reference

  • Registration of the twining_commits tool which calls engine.getByCommitHash.
    // twining_commits — Query decisions by commit hash
    server.registerTool(
      "twining_commits",
      {
        description:
          "Query decisions by commit hash. Returns all decisions that were linked to a given commit, enabling traceability from code changes back to decision rationale.",
        inputSchema: {
          commit_hash: z
            .string()
            .describe("Git commit hash to look up"),
        },
      },
      async (args) => {
        try {
          const result = await engine.getByCommitHash(args.commit_hash);
          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 implementation of getByCommitHash in DecisionEngine which executes the logic for twining_commits.
     * Get decisions linked to a specific commit hash.
     */
    async getByCommitHash(commitHash: string): Promise<{
      decisions: Array<{
        id: string;
        summary: string;
        domain: string;
        scope: string;
        confidence: string;
        timestamp: string;
        commit_hashes: string[];
      }>;
    }> {
      const decisions = await this.decisionStore.getByCommitHash(commitHash);
      return {
        decisions: decisions.map((d) => ({
          id: d.id,
          summary: d.summary,
          domain: d.domain,
          scope: d.scope,
          confidence: d.confidence,
          timestamp: d.timestamp,
          commit_hashes: d.commit_hashes,
        })),
      };
    }

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