Skip to main content
Glama

polarity_export

Export your full personal knowledge graph as JSON for backup or migration.

Instructions

Export the user's full personal knowledge graph (nodes + edges + counts) as JSON in polarity/v1 format. Use this when the user asks for a snapshot of their exocortex, wants their data, or asks to download their .polarity file. Returns the full graph; can be large.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the polarity_export tool in the TOOLS array, defining its name, description, input schema (empty object), and handler that delegates to client.export()
    {
      name: "polarity_export",
      description:
        "Export the user's full personal knowledge graph (nodes + edges + counts) as JSON in polarity/v1 format. Use this when the user asks for a snapshot of their exocortex, wants their data, or asks to download their .polarity file. Returns the full graph; can be large.",
      inputSchema: z.object({}).strict(),
      handler: async (_input, client) => client.export(),
    },
  • The export() method on CosmosClient that sends a POST request to /api/polarity/export with the polarity_user_id, returning an ExportResponse
    export() {
      return this.request<ExportResponse>({
        method: "POST",
        path: "/api/polarity/export",
        body: { polarity_user_id: this.config.polarityUserId },
      });
    }
  • ExportResponse type defining the structure returned by the polarity_export endpoint including format, exported_at, polarity_user_id, cosmos_user_id, nodes, edges, and counts
    export interface ExportResponse {
      format: string;
      exported_at: string;
      polarity_user_id: string;
      cosmos_user_id: number;
      nodes: PolarityNode[];
      edges: PolarityEdge[];
      counts: { nodes: number; edges: number };
    }
  • PolarityNode interface - the shape of each node in the exported knowledge graph
    export interface PolarityNode {
      id: number;
      type: string;
      label: string;
      content: string | null;
      source: string | null;
      confidence: number | null;
      weight: number | null;
      last_observed: string | null;
      reinforcement_count: number | null;
      emotional_score?: number | null;
      functional_network?: string | null;
      created_at?: string;
      updated_at?: string;
    }
  • PolarityEdge interface - the shape of each edge in the exported knowledge graph
    export interface PolarityEdge {
      id: number;
      from_id: number;
      to_id: number;
      label: string;
      strength: number;
      source: string | null;
      confidence: number | null;
      status: string;
      created_at?: string;
      updated_at?: string;
    }
Behavior3/5

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

No annotations are provided, so the description carries full burden. It discloses that the tool returns 'the full graph' and warns about size. However, it does not mention whether the operation is read-only, any authentication requirements, or side effects. The size warning is helpful but limited.

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 that front-load the core action and format, then provide usage guidance and a size warning. Every sentence adds value with no redundancy.

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

Completeness4/5

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

Given zero parameters, no output schema, and no annotations, the description covers the essential purpose, usage scenarios, and a key behavioral trait (size). It could mention if the export is synchronous or the response structure, but it is adequate for this simple tool.

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 zero parameters, so the description does not need to add parameter meaning. It appropriately explains what the tool exports without parameter details.

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 action (export), the exact resource (user's full personal knowledge graph), and the output format (JSON in polarity/v1 format). It is specific and distinct from sibling tools like polarity_dump or polarity_get_graph.

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 explicit usage scenarios: 'when the user asks for a snapshot of their exocortex, wants their data, or asks to download their .polarity file.' It also warns that the result 'can be large.' However, it does not mention when not to use it or suggest alternatives.

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/teampolarity/cosmos-mcp'

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