Skip to main content
Glama

get_my_agents

Retrieve and view your saved AI agents with their IDs, API keys, and current operational status from the conviction-mcp server.

Instructions

List your saved agents with their IDs, API keys, and status. Agents are saved locally when created via create_agent. Also fetches latest status from the server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Implementation of the "get_my_agents" tool, which lists saved agents from a local JSON file and fetches their status from the conviction.fm API.
    // ── Tool: get_my_agents ──
    
    server.tool(
      "get_my_agents",
      "List your saved agents with their IDs, API keys, and status. Agents are saved locally when created via create_agent. Also fetches latest status from the server.",
      {},
      async () => {
        const saved = loadSavedAgents();
    
        if (saved.length === 0) {
          return {
            content: [
              { type: "text", text: "No saved agents found. Use `create_agent` to create one." },
            ],
          };
        }
    
        // Try to fetch live status from server using the first agent's owner
        const ownerId = saved[0].ownerId;
        let serverAgents: any[] | null = null;
        try {
          const result = (await apiPost("update-agent", {
            action: "list_agents",
            ownerProfileId: ownerId,
          })) as any;
          if (result.success) serverAgents = result.agents;
        } catch { /* offline is fine, show local data */ }
    
        // Fetch on-chain balances in parallel for all agents with wallets
        const balanceMap: Record<string, number | null> = {};
        if (serverAgents) {
          const entries = await Promise.all(
            serverAgents
              .filter((s: any) => s.walletAddress)
              .map(async (s: any) => [s.id, await fetchOnChainBalance(s.walletAddress)] as [string, number | null])
          );
          for (const [id, bal] of entries) balanceMap[id] = bal;
        }
    
        const lines = saved.map((a) => {
          const server = serverAgents?.find((s: any) => s.id === a.agentId);
          const status = server ? (server.active ? "ACTIVE" : "PAUSED") : "unknown";
          const today = server?.today;
          const todayLine = today && today.count > 0
            ? `  Today: ${today.count} entries, $${today.spend.toFixed(2)} spent${today.lastAt ? `, last at ${new Date(today.lastAt).toISOString().replace("T", " ").slice(0, 19)} UTC` : ""}`
            : `  Today: no entries yet`;
          const onChainBal = balanceMap[a.agentId];
          const balanceLine = onChainBal != null ? `  Balance: ${onChainBal.toFixed(2)} bsUSD (on-chain)` : server ? `  Balance: $${server.balance?.toFixed(2) ?? "?"} (db)` : "";
          return [
            `**${a.name}** (${status})`,
            `  Agent ID: ${a.agentId}`,
            `  API Key: ${a.apiKey}`,
            `  Owner: ${a.ownerId}`,
            server?.walletAddress ? `  Wallet: ${server.walletAddress}` : "",
            balanceLine,
            todayLine,
          ].filter(Boolean).join("\n");
        });
    
        return {
          content: [
            {
              type: "text",
              text: `# Your Agents (${saved.length})\n\n${lines.join("\n\n")}\n\n_Fetched at ${new Date().toISOString()}_\n_Credentials stored in ~/.conviction/agents.json. Use get_agent_status for detailed activity log._`,
            },
          ],
        };
      }
    );
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool lists saved agents and fetches latest status from the server, which adds useful behavioral context. However, it lacks details on permissions, rate limits, or error handling, leaving gaps for a tool that interacts with a server.

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

Conciseness5/5

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

The description is two sentences, front-loaded with the main purpose and followed by additional context. Every sentence adds value: the first defines the action and resources, the second explains agent creation and server fetching. There is no wasted text.

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

Completeness3/5

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

Given no annotations and no output schema, the description provides basic purpose and context but lacks details on return format, error cases, or server interaction specifics. For a tool that fetches from a server, more completeness on behavioral aspects would be helpful, though it meets minimum viability.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description does not add parameter information, which is appropriate. Baseline is 4 for 0 parameters, as it efficiently avoids redundancy.

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

Purpose5/5

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

The description clearly states the specific action ('List your saved agents') and the resources involved ('with their IDs, API keys, and status'). It distinguishes from siblings by specifying it lists saved agents, unlike tools like 'create_agent' or 'get_agent_status' which have different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context by mentioning that agents are saved locally when created via 'create_agent', which implies when to use this tool (after creation). However, it does not explicitly state when not to use it or name alternatives among siblings, such as 'get_agent_status' for checking a specific agent's status.

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