Skip to main content
Glama

polarity_get_graph

Read your knowledge graph to examine self-image, the system's perspective, or the polarity alignment between the two.

Instructions

Read the user's graph view. entity selects which projection: 'user' (the user's self-graph), 'cosmos' (the cosmos entity's view of them), or 'polarity' (the dyadic synchronization between the two). Use 'user' for general questions about what the user thinks, does, or knows. Use 'polarity' when comparing the user's self-image against the system's observation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entityNo

Implementation Reference

  • The handler function for polarity_get_graph. It extracts the optional 'entity' parameter and delegates to CosmosClient.getGraph().
    handler: async (input, client) => {
      const { entity } = input as { entity?: "user" | "cosmos" | "polarity" };
      return client.getGraph(entity);
    },
  • Input schema for polarity_get_graph: optional 'entity' enum with values 'user', 'cosmos', or 'polarity'.
    inputSchema: z
      .object({
        entity: z.enum(["user", "cosmos", "polarity"]).optional(),
      })
      .strict(),
  • Registration of the 'polarity_get_graph' tool in the TOOLS array, with its name, description, schema, and handler.
    {
      name: "polarity_get_graph",
      description:
        "Read the user's graph view. `entity` selects which projection: 'user' (the user's self-graph), 'cosmos' (the cosmos entity's view of them), or 'polarity' (the dyadic synchronization between the two). Use 'user' for general questions about what the user thinks, does, or knows. Use 'polarity' when comparing the user's self-image against the system's observation.",
      inputSchema: z
        .object({
          entity: z.enum(["user", "cosmos", "polarity"]).optional(),
        })
        .strict(),
      handler: async (input, client) => {
        const { entity } = input as { entity?: "user" | "cosmos" | "polarity" };
        return client.getGraph(entity);
      },
    },
  • CosmosClient.getGraph() makes a GET request to /api/polarity with the optional entity query param and returns a GraphResponse.
    getGraph(entity?: "user" | "cosmos" | "polarity") {
      return this.request<GraphResponse>({
        method: "GET",
        path: "/api/polarity",
        query: { entity },
      });
    }
  • Response type for getGraph, containing nodes, edges, orbit_edges, communities, observations, user, cosmos, and sync_edges fields.
    export interface GraphResponse {
      nodes: PolarityNode[];
      edges?: PolarityEdge[];
      orbit_edges?: PolarityEdge[];
      communities?: unknown[];
      observations?: unknown[];
      user?: unknown;
      cosmos?: unknown;
      sync_edges?: unknown[];
    }
Behavior4/5

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

The description uses 'Read', indicating a read-only operation with no side effects. While no annotations are present, the verb is clear. However, it does not explicitly state that it is safe or mention any permissions, which could be improved.

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 three sentences: purpose, parameter explanation, and usage guidance. Every sentence adds value, and there is no redundant information.

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?

The description covers purpose, parameter, and usage well. However, it lacks any mention of the output format or structure of the graph view, which would be helpful given there is no output schema.

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

Parameters5/5

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

The only parameter ('entity') is fully explained with its three enum values and their meanings. This adds significant value beyond the schema, which only lists the enum without descriptions.

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 verb 'Read' and the resource 'user's graph view,' and differentiates three projections ('user', 'cosmos', 'polarity'). This distinguishes it from sibling tools like 'polarity_ask' or 'polarity_dump'.

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?

Explicit guidance is provided for when to use each entity value: 'Use 'user' for general questions' and 'Use 'polarity' when comparing...', which helps the agent select the correct parameter value.

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