Skip to main content
Glama

twining_promote

Promote provisional decisions to active status after validation through implementation and testing. Confirm decisions that have been successfully verified.

Instructions

Promote one or more provisional decisions to active status. Use this to confirm provisional decisions that have been validated through implementation and testing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
decision_idsYesIDs of provisional decisions to promote to active
promoted_byNoWho is promoting (default: "main")

Implementation Reference

  • The business logic implementation for the 'promote' operation, which updates provisional decisions to 'active' status.
    async promote(
      decisionIds: string[],
      promotedBy?: string,
    ): Promise<{
      promoted: string[];
      already_active: string[];
      not_found: string[];
      wrong_status: Array<{ id: string; status: string }>;
    }> {
      const result: {
        promoted: string[];
        already_active: string[];
        not_found: string[];
        wrong_status: Array<{ id: string; status: string }>;
      } = {
        promoted: [],
        already_active: [],
        not_found: [],
        wrong_status: [],
      };
    
      for (const id of decisionIds) {
        const decision = await this.decisionStore.get(id);
        if (!decision) {
          result.not_found.push(id);
          continue;
        }
    
        if (decision.status === "active") {
          result.already_active.push(id);
          continue;
        }
    
        if (decision.status !== "provisional") {
          result.wrong_status.push({ id, status: decision.status });
          continue;
        }
    
        await this.decisionStore.updateStatus(id, "active");
        result.promoted.push(id);
      }
    
      // Post a single status entry if any were promoted
      if (result.promoted.length > 0) {
        await this.blackboardEngine.post({
          entry_type: "status",
          summary:
            `Promoted ${result.promoted.length} provisional decision(s) to active`.slice(
              0,
              200,
            ),
          detail: `Decision IDs: ${result.promoted.join(", ")}`,
          scope: "project",
          agent_id: promotedBy ?? "main",
        });
      }
    
      return result;
    }
  • The MCP tool registration for 'twining_promote', which delegates the request to the DecisionEngine 'promote' method.
    // twining_promote — Promote provisional decisions to active
    server.registerTool(
      "twining_promote",
      {
        description:
          "Promote one or more provisional decisions to active status. Use this to confirm provisional decisions that have been validated through implementation and testing.",
        inputSchema: {
          decision_ids: z
            .array(z.string())
            .min(1)
            .describe("IDs of provisional decisions to promote to active"),
          promoted_by: z
            .string()
            .optional()
            .describe('Who is promoting (default: "main")'),
        },
      },
      async (args) => {
        try {
          const result = await engine.promote(
            args.decision_ids,
            args.promoted_by,
          );
          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",
          );
        }
      },
    );

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