Skip to main content
Glama

cortex_get_organization

Retrieve details for a specific organization using a superadmin API key.

Instructions

Get details about a specific organization (requires superadmin API key)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orgIdYesThe organization ID or name

Implementation Reference

  • The MCP tool handler for 'cortex_get_organization'. It registers the tool with the MCP server using server.tool(), accepts an 'orgId' string parameter, checks superadmin availability, calls client.getOrganization(orgId), and returns the organization details as JSON.
    server.tool(
      "cortex_get_organization",
      "Get details about a specific organization (requires superadmin API key)",
      {
        orgId: z.string().describe("The organization ID or name"),
      },
      async ({ orgId }) => {
        try {
          if (!client.superadminAvailable) {
            return {
              content: [
                {
                  type: "text" as const,
                  text: "Organization management requires CORTEX_SUPERADMIN_KEY environment variable to be set.",
                },
              ],
              isError: true,
            };
          }
    
          const org = await client.getOrganization(orgId);
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify(org, null, 2),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text" as const,
                text: `Error getting organization: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
            isError: true,
          };
        }
      },
    );
  • The input schema for 'cortex_get_organization' defined via Zod: orgId is a required string with description 'The organization ID or name'.
    server.tool(
      "cortex_get_organization",
      "Get details about a specific organization (requires superadmin API key)",
      {
        orgId: z.string().describe("The organization ID or name"),
      },
      async ({ orgId }) => {
        try {
          if (!client.superadminAvailable) {
            return {
              content: [
                {
                  type: "text" as const,
                  text: "Organization management requires CORTEX_SUPERADMIN_KEY environment variable to be set.",
                },
              ],
              isError: true,
            };
          }
    
          const org = await client.getOrganization(orgId);
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify(org, null, 2),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text" as const,
                text: `Error getting organization: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
            isError: true,
          };
        }
      },
    );
  • The CortexClient.getOrganization() method that makes the actual HTTP GET request to '/organization/{orgId}' using superadmin auth and returns the Organization.
    async getOrganization(orgId: string): Promise<Organization> {
      return this.request<Organization>(
        `/organization/${encodeURIComponent(orgId)}`,
        {},
        true,
      );
    }
  • The Organization interface returned by getOrganization, defining all fields (id, name, description, status, createdAt, createdBy, etc.).
    export interface Organization {
      id: string;
      name: string;
      description: string;
      status: string;
      createdAt?: number;
      createdBy?: string;
      updatedAt?: number;
      updatedBy?: string;
      _type?: string;
    }
  • src/index.ts:43-43 (registration)
    Registration call: registerOrganizationTools(server, client) which registers all organization tools including 'cortex_get_organization'.
    registerOrganizationTools(server, client);
Behavior3/5

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

The description adds a behavioral constraint ('requires superadmin API key') but does not explicitly state read-only nature or other side effects. With no annotations, the description partially covers behavioral transparency but lacks depth (e.g., no mention of idempotency or rate limits).

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 a single, efficient sentence with no unnecessary words. Every word contributes to the purpose and constraint.

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?

No output schema is provided, and the description fails to explain what 'details' are returned (e.g., fields like name, status). The description is insufficient for an agent to fully understand the tool's behavioral output.

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?

Input schema has 100% description coverage for the single parameter ('orgId'). The description does not add meaning beyond what the schema already provides, resulting in a baseline score of 3.

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 ('Get'), resource ('organization'), and a key constraint ('requires superadmin API key'). It distinguishes from siblings like 'cortex_list_organizations' and 'cortex_update_organization' by specifying a single organization retrieval.

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

Usage Guidelines3/5

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

The description implies usage for fetching a specific organization's details but does not explicitly provide when-to-use or when-not-to-use guidance relative to siblings. No exclusion criteria or alternatives are mentioned.

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/solomonneas/cortex-mcp'

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