Skip to main content
Glama

get_accounts

Read-onlyIdempotent

Retrieve a list of accounts with pagination and filters including search, user ID, key contact, and account type.

Instructions

Get all accounts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoCursor for fetching the next page of results
per_pageNoNumber of results per page (default: 25)
searchNoFilter results on search
key_contact_user_idNoFilter results on key_contact_user_id
user_idNoFilter results on user_id
account_typeNoFilter results on account_type

Implementation Reference

  • The handler function for the get_accounts tool. It calls apiList on /accounts with optional filter parameters (cursor, per_page, search, key_contact_user_id, user_id, account_type), logs the response, formats results using formatList, and appends a next-page cursor hint if pagination is available.
      async ({ cursor, per_page, search, key_contact_user_id, user_id, account_type }) => {
        try {
          const result = await apiList<EduframeRecord>("/accounts", {
            cursor,
            per_page,
            search,
            key_contact_user_id,
            user_id,
            account_type,
          });
          void logResponse(
            "get_accounts",
            { cursor, per_page, search, key_contact_user_id, user_id, account_type },
            result,
          );
          const toolResult = formatList(result.records, "accounts");
          if (result.nextCursor) {
            toolResult.content.push({ type: "text", text: `\nNext page cursor: ${result.nextCursor}` });
          }
          return toolResult;
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • Input schema for the get_accounts tool. All parameters are optional: cursor (string), per_page (positive int), search (string), key_contact_user_id (int), user_id (int), and account_type (enum: 'business' | 'personal').
    {
      description: "Get all accounts",
      annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
      inputSchema: {
        cursor: z.string().optional().describe("Cursor for fetching the next page of results"),
        per_page: z.number().int().positive().optional().describe("Number of results per page (default: 25)"),
        search: z.string().optional().describe("Filter results on search"),
        key_contact_user_id: z.number().int().optional().describe("Filter results on key_contact_user_id"),
        user_id: z.number().int().optional().describe("Filter results on user_id"),
        account_type: z.enum(["business", "personal"]).optional().describe("Filter results on account_type"),
      },
  • The get_accounts tool is registered via server.registerTool inside the registerAccountTools function, using the tool name "get_accounts".
    export function registerAccountTools(server: McpServer): void {
      server.registerTool(
  • The registerAllTools function iterates over all tool registration functions (including registerAccountTools) and calls each with the MCP server instance.
    export function registerAllTools(server: McpServer): void {
      for (const register of tools) {
        register(server);
      }
    }
  • The apiList helper function performs a paginated GET request to the API, used by get_accounts to fetch /accounts. It returns both the records array and the next cursor for pagination.
    export async function apiList<T>(path: string, query?: Record<string, QueryValue>): Promise<ListResult<T>> {
      const { token } = getConfig();
      const url = buildUrl(path, query);
    
      const response = await fetch(url.toString(), {
        method: "GET",
        headers: buildHeaders(token),
      });
    
      await checkResponse(response);
    
      const records = (await response.json()) as T[];
      const nextCursor = parseNextCursor(response.headers.get("Link"));
    
      return { records, nextCursor };
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, so safety is covered. The description adds no further behavioral context beyond 'Get all accounts', such as pagination or return format. With annotations present, the description's lack of detail is acceptable but not additive.

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

Conciseness4/5

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

The description is a single sentence with no wasted words. It is concise, though it could include a bit more structure (e.g., mentioning pagination). Still, it is appropriately sized for a simple list endpoint.

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?

Despite the schema covering parameters, the description misses critical context: it doesn't state that the tool returns a list of accounts, supports pagination (cursor, per_page), or filtering. For a tool with 6 optional parameters and no output schema, more contextual detail is needed to help the agent use it correctly.

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% coverage with descriptions for all 6 parameters. The description itself does not elaborate on parameter usage, but since the schema already explains them, the description adds no extra meaning. Baseline 3 is appropriate.

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

Purpose4/5

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

The description 'Get all accounts' clearly states the verb and resource, but doesn't differentiate from sibling tool 'get_account' (singular) or other listing tools. It's clear but not specific about scope (e.g., pagination or filtering) that would distinguish it further.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives like get_account or other list tools. The description lacks context for appropriate usage, making the agent rely on the tool name alone.

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/martijnpieters/eduframe-mcp'

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