Skip to main content
Glama

list_user

Retrieve stored user data and token information from a token store to manage authentication records.

Instructions

List stored users and tokens from a token store

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folderYesFolder where the token file is stored
fileNoOptional token file name (default: tokens.json)
titlesOnlyNoReturn only user titles instead of full token entries

Implementation Reference

  • Handler for the 'list_user' tool. Reads the token store file from the given folder (and optional file), parses tokens, and returns either full entries or just titles based on 'titlesOnly' flag. Handles errors by returning error details.
    case "list_user": {
      const folder = String(args?.folder || '');
      const file = args?.file ? String(args.file) : undefined;
      const titlesOnly = Boolean(args?.titlesOnly);
    
      if (!folder) {
        throw new Error("folder is required to read the token store");
      }
    
      try {
        const { filePath, tokens } = readTokenStore(folder, file);
        const result = titlesOnly
          ? tokens
              .map((entry) => entry?.user_title_name)
              .filter((title): title is string => Boolean(title))
          : tokens;
    
        return {
          content: [{
            type: "text",
            text: JSON.stringify(
              {
                file: filePath,
                users: result
              },
              null,
              2
            )
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: JSON.stringify(
              {
                error: 'Unable to list users from token store',
                details: error instanceof Error ? error.message : String(error)
              },
              null,
              2
            )
          }]
        };
      }
    }
  • src/index.ts:283-304 (registration)
    Tool registration for 'list_user' including name, description, and input schema definition in the ListTools response.
    {
      name: "list_user",
      description: "List stored users and tokens from a token store",
      inputSchema: {
        type: "object",
        properties: {
          folder: {
            type: "string",
            description: "Folder where the token file is stored"
          },
          file: {
            type: "string",
            description: "Optional token file name (default: tokens.json)"
          },
          titlesOnly: {
            type: "boolean",
            description: "Return only user titles instead of full token entries"
          }
        },
        required: ["folder"]
      }
    },
  • Input schema for the 'list_user' tool defining parameters: folder (required), optional file, and titlesOnly boolean.
    inputSchema: {
      type: "object",
      properties: {
        folder: {
          type: "string",
          description: "Folder where the token file is stored"
        },
        file: {
          type: "string",
          description: "Optional token file name (default: tokens.json)"
        },
        titlesOnly: {
          type: "boolean",
          description: "Return only user titles instead of full token entries"
        }
      },
      required: ["folder"]
  • Helper function called by the list_user handler to resolve the token file path, read its contents, parse JSON, validate array format, and return filePath and tokens.
    function readTokenStore(folder: string, file?: string): { filePath: string; tokens: any[] } {
      const filePath = resolveCustomTokenPath(folder, file);
    
      if (!existsSync(filePath)) {
        throw new Error(`Token store not found at ${filePath}`);
      }
    
      try {
        const raw = readFileSync(filePath, 'utf-8');
        const parsed = JSON.parse(raw);
    
        if (!Array.isArray(parsed)) {
          throw new Error(`Token store at ${filePath} is not an array`);
        }
    
        return { filePath, tokens: parsed };
      } catch (error) {
        throw new Error(
          `Unable to read token store at ${filePath}: ${error instanceof Error ? error.message : String(error)}`
        );
      }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions 'List stored users and tokens' but doesn't disclose behavioral traits such as whether this is a read-only operation, potential side effects, error handling, or output format. This leaves significant gaps for a tool that interacts with a token store.

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 that directly states the tool's function without unnecessary words. It is appropriately sized and front-loaded, making it easy to understand at a glance.

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?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., list format, token details) or address potential complexities like error cases or permissions needed for accessing the token store, leaving the agent with insufficient context.

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?

The input schema has 100% description coverage, so parameters are well-documented there. The description adds no additional meaning beyond the schema, such as explaining the relationship between 'folder' and 'file' or the implications of 'titlesOnly'. Baseline 3 is appropriate as the schema does the heavy lifting.

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 clearly states the action ('List') and resource ('stored users and tokens from a token store'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'get' or 'clear_user', which could also involve user/token operations, so it misses the highest score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'get' or 'clear_user', nor does it mention any prerequisites or context for usage. It simply states what the tool does without indicating appropriate scenarios.

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/vilasone455/api-mcp'

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