Skip to main content
Glama

list_profiles

Retrieve all configured identity profiles with their credentials and identify the currently active profile.

Instructions

[Plugin] List all available identity profiles (each profile has its own LARK_COOKIE / APP_ID / APP_SECRET / UAT). v1.3.9 SSOT: profiles live in ~/.feishu-user-plugin/credentials.json::profiles. Legacy fallback: LARK_PROFILES_JSON env var. Marks the currently active profile.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual handler function for the list_profiles tool. Calls ctx.getActiveProfile() and ctx.listProfiles() to return the current active profile name and all available profile names as JSON.
    async list_profiles(_args, ctx) {
      return json({ active: ctx.getActiveProfile(), profiles: ctx.listProfiles() });
    },
  • The MCP tool schema definition for list_profiles. It has no required inputs (empty inputSchema) and describes that it lists available identity profiles and marks the active one.
    {
      name: 'list_profiles',
      description: '[Plugin] List all available identity profiles (each profile has its own LARK_COOKIE / APP_ID / APP_SECRET / UAT). v1.3.9 SSOT: profiles live in ~/.feishu-user-plugin/credentials.json::profiles. Legacy fallback: LARK_PROFILES_JSON env var. Marks the currently active profile.',
      inputSchema: { type: 'object', properties: {} },
    },
  • src/server.js:37-57 (registration)
    Tool module registration in server.js. The profile module (containing list_profiles) is loaded and its schemas/handlers are flattened into TOOLS and HANDLERS for MCP dispatch.
    const TOOL_MODULES = [
      require('./tools/bitable'),
      require('./tools/calendar'),
      require('./tools/contacts'),
      require('./tools/diagnostics'),
      require('./tools/docs'),
      require('./tools/drive'),
      require('./tools/events'),
      require('./tools/groups'),
      require('./tools/im-read'),
      require('./tools/messaging-bot'),
      require('./tools/messaging-user'),
      require('./tools/okr'),
      require('./tools/profile'),
      require('./tools/tasks'),
      require('./tools/uploads'),
      require('./tools/wiki'),
    ];
    
    const TOOLS = TOOL_MODULES.flatMap((m) => m.schemas);
    const HANDLERS = Object.fromEntries(TOOL_MODULES.flatMap((m) => Object.entries(m.handlers)));
  • src/server.js:391-412 (registration)
    MCP CallTool request handler that dispatches to the registered handler by name. When list_profiles is called, it looks up HANDLERS['list_profiles'] and invokes it via profileRouter.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      // Cross-process active-profile sync (v1.3.9 A.2): if another MCP process
      // wrote a new `active` field to credentials.json, pick it up before dispatch.
      _syncActiveProfileFromDisk();
      const { name, arguments: args } = request.params;
      const handler = HANDLERS[name];
      if (!handler) {
        return { content: [{ type: 'text', text: `Unknown tool: ${name}` }], isError: true };
      }
      // Strip via_profile from args before passing to the handler — it's a
      // routing-layer concern, not a tool argument. Keep a copy for routing.
      const cleanArgs = (args && typeof args === 'object') ? { ...args } : {};
      delete cleanArgs.via_profile;
    
      try {
        return await profileRouter.withProfileRouting(buildCtx(), name, args || {}, async () => {
          return handler(cleanArgs, buildCtx());
        });
      } catch (err) {
        return { content: [{ type: 'text', text: `Error: ${err.message}` }], isError: true };
      }
    });
  • The ctx helper methods used by the list_profiles handler. listProfiles() delegates to credentials.listProfileNames(), and getActiveProfile() returns the current in-memory profile name.
    listProfiles: () => credentials.listProfileNames(),
    getActiveProfile: () => currentProfile,
Behavior4/5

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

No annotations provided, but the description discloses the tool reads from a specific file and a legacy environment variable, and marks the active profile. This provides sufficient behavioral context for a read-only list operation.

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 concise, front-loading the purpose, and includes technical specifics (file path, version, fallback) without unnecessary fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity of the tool (no parameters, no output schema), the description fully covers its functionality, data sources, and side effect (marking active profile).

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

Parameters4/5

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

Input schema has zero parameters, so baseline is 4. The description adds value by explaining what is listed (LARK_COOKIE, APP_ID, etc.) and the data source, though no parameter details are needed.

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 explicitly states the tool's purpose: 'List all available identity profiles' with details on the credentials each profile contains, clearly distinguishing it from sibling tools like 'switch_profile'.

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

Usage Guidelines4/5

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

The description indicates this tool is for listing profiles and marks the active profile, but does not explicitly state when to use it over alternatives; however, with no other profile-listing sibling, it's adequately clear.

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/EthanQC/feishu-user-plugin'

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