Skip to main content
Glama

toggle_agent

Pause or resume an agent's automatic strategy execution in the conviction-mcp server. When paused, the agent stops entering pools via cron while manual entries remain functional.

Instructions

Pause or resume an agent's automatic strategy execution. When paused, the agent stops entering pools via cron. Manual entries via enter_position still work.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idNoThe agent's profile ID. Auto-filled from saved credentials if omitted.
owner_idNoThe owner's profile ID. Auto-filled from saved credentials if omitted.

Implementation Reference

  • The handler for the `toggle_agent` MCP tool, which pauses or resumes an agent's automatic strategy execution by calling the `update-agent` API with the `toggle` action.
    // ── Tool: toggle_agent ──
    
    server.tool(
      "toggle_agent",
      "Pause or resume an agent's automatic strategy execution. When paused, the agent stops entering pools via cron. Manual entries via enter_position still work.",
      {
        agent_id: z.string().optional().describe("The agent's profile ID. Auto-filled from saved credentials if omitted."),
        owner_id: z.string().optional().describe("The owner's profile ID. Auto-filled from saved credentials if omitted."),
      },
      async ({ agent_id, owner_id }) => {
        const saved = loadSavedAgents();
        const resolvedAgent = agent_id || (saved.length > 0 ? saved[saved.length - 1].agentId : null);
        const resolvedOwner = owner_id || (saved.length > 0 ? saved[saved.length - 1].ownerId : null);
        if (!resolvedAgent || !resolvedOwner) {
          return { content: [{ type: "text", text: "No agent found. Create one first with `create_agent`, or pass agent_id and owner_id." }], isError: true };
        }
    
        const result = (await apiPost("update-agent", {
          action: "toggle",
          agentId: resolvedAgent,
          ownerProfileId: resolvedOwner,
        })) as any;
    
        if (!result.success) {
          return {
            content: [{ type: "text", text: `Toggle failed: ${result.error || "Unknown error"}` }],
            isError: true,
          };
        }
    
        return {
          content: [
            {
              type: "text",
              text: `Agent **${agent_id}** is now **${result.active ? "ACTIVE" : "PAUSED"}**. ${result.message || ""}`,
            },
          ],
        };
      }
    );

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/abcxz/conviction-fm'

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