Skip to main content
Glama

get_authentications_by_user_id

Read-onlyIdempotent

Fetch paginated authentication records for a user, optionally filtered by provider.

Instructions

Get the authentications of an user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYesID of the parent resource
cursorNoCursor for fetching the next page of results
per_pageNoNumber of results per page (default: 25)
providerNoFilter results on provider

Implementation Reference

  • The async handler function for 'get_authentications_by_user_id'. It calls apiList on `/users/${user_id}/authentications`, logs the response, formats the result with formatList, and appends the next cursor if paginated.
    async ({ user_id, cursor, per_page, provider }) => {
      try {
        const result = await apiList<EduframeRecord>(`/users/${user_id}/authentications`, {
          cursor,
          per_page,
          provider,
        });
        void logResponse("get_authentications_by_user_id", { user_id, cursor, per_page, provider }, result);
        const toolResult = formatList(result.records, "authentications");
        if (result.nextCursor) {
          toolResult.content.push({ type: "text", text: `\nNext page cursor: ${result.nextCursor}` });
        }
        return toolResult;
      } catch (error) {
        return formatError(error);
      }
    },
  • Input schema definition for 'get_authentications_by_user_id' including user_id (required), cursor, per_page, and provider (optional) parameters with Zod validation.
    {
      description: "Get the authentications of an user",
      annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
      inputSchema: {
        user_id: z.number().int().positive().describe("ID of the parent resource"),
        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)"),
        provider: z
          .enum(["azure_active_directory", "eduframe", "openid_connect", "surf_conext"])
          .optional()
          .describe("Filter results on provider"),
      },
    },
  • Registration of the tool via server.registerTool with name 'get_authentications_by_user_id', its schema, annotations, and handler.
    server.registerTool(
      "get_authentications_by_user_id",
      {
        description: "Get the authentications of an user",
        annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
        inputSchema: {
          user_id: z.number().int().positive().describe("ID of the parent resource"),
          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)"),
          provider: z
            .enum(["azure_active_directory", "eduframe", "openid_connect", "surf_conext"])
            .optional()
            .describe("Filter results on provider"),
        },
      },
      async ({ user_id, cursor, per_page, provider }) => {
        try {
          const result = await apiList<EduframeRecord>(`/users/${user_id}/authentications`, {
            cursor,
            per_page,
            provider,
          });
          void logResponse("get_authentications_by_user_id", { user_id, cursor, per_page, provider }, result);
          const toolResult = formatList(result.records, "authentications");
          if (result.nextCursor) {
            toolResult.content.push({ type: "text", text: `\nNext page cursor: ${result.nextCursor}` });
          }
          return toolResult;
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • The apiList helper function that performs the actual GET request to the Eduframe REST API with cursor-based pagination support.
    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. Description adds no additional behavioral context (e.g., pagination behavior, rate limits, or that results are ordered). Does not contradict annotations.

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?

Single sentence with no superfluous words. However, it is arguably too terse; a bit more context (e.g., scope of 'authentications') would improve without harming conciseness.

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. Tool returns a paginated list with filtering options, but description omits pagination (cursor, per_page) and provider filter. Agent may miss key usage details for correct invocation.

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 all parameters. The description adds no extra meaning beyond what the schema provides, so baseline score applies.

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?

Description clearly states verb 'Get' and resource 'authentications' scoped to a user. Differentiates from sibling tools like 'create_authentication' and 'delete_authentication_from_user', which involve mutation.

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 (e.g., get_authentication by ID), and no mention of prerequisites or context. Agent must infer usage solely from the name and schema.

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