Skip to main content
Glama

update_strategy

Modify an agent's decision-making rules to adapt its competitive behavior in strategy competitions. The system automatically recompiles the updated strategy for immediate implementation.

Instructions

Update an agent's strategy. The new rules will be recompiled automatically. Requires the agent's ID and owner profile ID.

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.
new_rulesYesNew natural language strategy to replace the current one

Implementation Reference

  • The 'update_strategy' tool registration and handler. It takes agent_id, owner_id, and new_rules, then calls the backend API to update the strategy.
    // ── Tool: update_strategy ──
    
    server.tool(
      "update_strategy",
      "Update an agent's strategy. The new rules will be recompiled automatically. Requires the agent's ID and owner profile ID.",
      {
        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."),
        new_rules: z.string().describe("New natural language strategy to replace the current one"),
      },
      async ({ agent_id, owner_id, new_rules }) => {
        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: "update_rules",
          agentId: resolvedAgent,
          ownerProfileId: resolvedOwner,
          newRules: new_rules,
        })) as any;
    
        if (!result.success) {
          return {
            content: [{ type: "text", text: `Update failed: ${result.error || "Unknown error"}` }],
            isError: true,
          };
        }
    
        return {
          content: [
            {
              type: "text",
              text: [
                "# Strategy Updated",
                "",
                `**Agent:** ${agent_id}`,
                `**New Rules:** ${result.rules || new_rules}`,
                `**Compiled:** ${result.compiled?.success ? `Yes (${result.compiled.rulesCount} rules)` : "Failed — will retry"}`,
                "",
                result.message || "",
              ].join("\n"),
            },
          ],
        };
      }
    );
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool updates strategy and that new rules are recompiled automatically, which implies mutation and a processing step. However, it lacks critical details: no mention of permissions required, whether changes are reversible, potential side effects, error conditions, or response format. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the core purpose and followed by prerequisite information. It avoids redundancy and wasted words, though it could be slightly more structured by explicitly separating purpose from requirements. Overall, it's efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (mutation operation with 3 parameters), lack of annotations, and no output schema, the description is insufficiently complete. It covers the basic purpose and parameters but misses behavioral context like permissions, reversibility, error handling, and response details. For a strategy update tool that could have significant impacts, more comprehensive guidance is needed to ensure safe and effective use.

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 already documents all three parameters thoroughly. The description adds minimal value beyond the schema: it implies 'agent_id' and 'owner_id' are required (though schema shows they're optional with auto-fill), and 'new_rules' replaces the current strategy. No additional syntax, format, or contextual details are provided beyond what's in the schema descriptions, meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Update an agent's strategy') and resource ('agent's strategy'), specifying that new rules will be recompiled automatically. It distinguishes from siblings like 'create_agent' or 'toggle_agent' by focusing on strategy modification rather than creation or state changes. However, it doesn't explicitly differentiate from potential similar update operations on other agent attributes.

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 mentions prerequisites ('Requires the agent's ID and owner profile ID') but provides no guidance on when to use this tool versus alternatives. It doesn't specify scenarios where updating strategy is appropriate, contrast with other tools like 'toggle_agent' for activation, or indicate any constraints or conditions for usage beyond the required parameters.

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

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