Skip to main content
Glama
collapseindex

CI-1T Prediction Stability Engine

fleet_session_create

Create a new persistent fleet monitoring session with up to 16 nodes. Returns a session ID for subsequent rounds of stability checks.

Instructions

Create a new persistent fleet monitoring session. Returns a session ID for subsequent rounds. Max 16 nodes. Response: { session_id, node_count, node_names, created_at }. Workflow: fleet_session_create → fleet_session_round (repeat) → fleet_session_state (check) → fleet_session_delete (cleanup).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
node_countYesNumber of nodes in the fleet
node_namesNoOptional names for each node (must match node_count)

Implementation Reference

  • src/index.ts:611-630 (registration)
    The tool 'fleet_session_create' is registered via server.tool() with schema definition and handler in a single block.
    server.tool(
      "fleet_session_create",
      "Create a new persistent fleet monitoring session. Returns a session ID for subsequent rounds. Max 16 nodes. Response: { session_id, node_count, node_names, created_at }. Workflow: fleet_session_create → fleet_session_round (repeat) → fleet_session_state (check) → fleet_session_delete (cleanup).",
      {
        node_count: z.number().int().min(1).max(16).describe("Number of nodes in the fleet"),
        node_names: z.array(z.string()).optional().describe("Optional names for each node (must match node_count)"),
      },
      async ({ node_count, node_names }) => {
        const guard = requireApiKey();
        if (guard) return guard;
        const body: Record<string, unknown> = { action: "create", node_count };
        if (node_names) body.node_names = node_names;
        const result = await apiFetch("/api/fleet-session", {
          method: "POST",
          headers: apiKeyHeaders(),
          body,
        });
        return formatResult(result);
      }
    );
  • Input schema for fleet_session_create: node_count (int 1-16 required) and node_names (optional string array).
    {
      node_count: z.number().int().min(1).max(16).describe("Number of nodes in the fleet"),
      node_names: z.array(z.string()).optional().describe("Optional names for each node (must match node_count)"),
    },
  • Handler function that authenticates via requireApiKey(), then POSTs to /api/fleet-session with action='create', node_count, and optional node_names.
      async ({ node_count, node_names }) => {
        const guard = requireApiKey();
        if (guard) return guard;
        const body: Record<string, unknown> = { action: "create", node_count };
        if (node_names) body.node_names = node_names;
        const result = await apiFetch("/api/fleet-session", {
          method: "POST",
          headers: apiKeyHeaders(),
          body,
        });
        return formatResult(result);
      }
    );
  • formatResult helper used by the handler to format the API response as MCP text content.
    function formatResult(result: ApiResult): { content: Array<{ type: "text"; text: string }> } {
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify(result.data, null, 2),
          },
        ],
      };
    }
  • apiFetch helper used by the handler to make HTTP requests to the backend API.
    async function apiFetch(
      path: string,
      opts: { method?: string; headers?: Record<string, string>; body?: unknown } = {}
    ): Promise<ApiResult> {
      const url = `${BASE_URL}${path}`;
      try {
        const res = await fetch(url, {
          method: opts.method || "GET",
          headers: opts.headers || { "Content-Type": "application/json" },
          body: opts.body ? JSON.stringify(opts.body) : undefined,
        });
        const text = await res.text();
        let data: unknown;
        try {
          data = JSON.parse(text);
        } catch {
          data = { raw: text };
        }
        return { ok: res.ok, status: res.status, data };
      } catch (err: unknown) {
        const message = err instanceof Error ? err.message : String(err);
        return { ok: false, status: 0, data: { error: `Network error: ${message}` } };
      }
    }
Behavior4/5

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

Discloses return format (session ID and fields) and constraints. Without annotations, could mention idempotency or side effects, but current description is adequate.

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?

Two sentences plus workflow line; no redundancy. Front-loaded with purpose and key info.

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

Completeness5/5

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

Covers all aspects: purpose, constraints, response, workflow. No output schema needed given detailed response description.

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?

Schema coverage is 100% (baseline 3). Description adds meaning by clarifying node_names must match node_count, which schema does not enforce.

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?

Clearly states 'Create a new persistent fleet monitoring session' with specific verb-resource pair. Distinguishes from sibling tools like fleet_session_delete and fleet_session_state.

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

Usage Guidelines5/5

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

Explicitly provides full workflow: fleet_session_create → fleet_session_round (repeat) → fleet_session_state (check) → fleet_session_delete (cleanup). Also notes 'Max 16 nodes' constraint.

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/collapseindex/ci-1t-mcp'

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