Skip to main content
Glama
konsulto

@konsulto/mcp

Official
by konsulto

konsulto_whoami

Retrieve current user identity, tenant, role permissions, MCP token expiry, and active audit pin to orient the session before performing any actions.

Instructions

Show who the MCP is acting as, their permissions, the active audit, and how authentication is configured. Call this first in any session to orient yourself before performing actions. Returns user identity, tenant, role permissions, MCP token expiry, and active audit pin.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the konsulto_whoami tool. Calls GET /users/profile to fetch identity, permissions, and tenant info, gets the active audit from session state, and includes workspace config pin. No input schema needed (empty object {}). Uses ok() helper to return JSON result.
    server.tool(
      'konsulto_whoami',
      'Show who the MCP is acting as, their permissions, the active audit, and ' +
        'how authentication is configured. Call this first in any session to ' +
        'orient yourself before performing actions. Returns user identity, ' +
        'tenant, role permissions, MCP token expiry, and active audit pin.',
      {},
      async () => {
        try {
          const profile = (await client.get<any>('/users/profile')) as any;
          const active = state.getActiveAudit();
          return ok({
            user: {
              id: profile?._id ?? profile?.userId,
              username: profile?.username,
              email: profile?.email,
              name: [profile?.firstName, profile?.lastName].filter(Boolean).join(' ') || profile?.username,
            },
            tenant: {
              features: profile?.tenantFeatures ?? {},
            },
            permissions: profile?.resolvedPermissions ?? [],
            activeAudit: active,
            workspaceConfig: workspace
              ? { configPath: workspace.configPath, pinnedAudit: workspace.audit }
              : null,
          });
        } catch (err) {
          return errResult(err);
        }
      },
    );
  • src/server.ts:70-101 (registration)
    Registration of konsulto_whoami via server.tool() on the McpServer instance. The tool is registered in the buildServer() function along with all other tools.
    server.tool(
      'konsulto_whoami',
      'Show who the MCP is acting as, their permissions, the active audit, and ' +
        'how authentication is configured. Call this first in any session to ' +
        'orient yourself before performing actions. Returns user identity, ' +
        'tenant, role permissions, MCP token expiry, and active audit pin.',
      {},
      async () => {
        try {
          const profile = (await client.get<any>('/users/profile')) as any;
          const active = state.getActiveAudit();
          return ok({
            user: {
              id: profile?._id ?? profile?.userId,
              username: profile?.username,
              email: profile?.email,
              name: [profile?.firstName, profile?.lastName].filter(Boolean).join(' ') || profile?.username,
            },
            tenant: {
              features: profile?.tenantFeatures ?? {},
            },
            permissions: profile?.resolvedPermissions ?? [],
            activeAudit: active,
            workspaceConfig: workspace
              ? { configPath: workspace.configPath, pinnedAudit: workspace.audit }
              : null,
          });
        } catch (err) {
          return errResult(err);
        }
      },
    );
  • The konsulto_whoami tool has an empty schema object {} — it accepts no inputs. It is a pure query tool that returns current session context.
    server.tool(
      'konsulto_whoami',
      'Show who the MCP is acting as, their permissions, the active audit, and ' +
        'how authentication is configured. Call this first in any session to ' +
        'orient yourself before performing actions. Returns user identity, ' +
        'tenant, role permissions, MCP token expiry, and active audit pin.',
      {},
  • The ok() helper is used by konsulto_whoami to wrap the JSON response into the MCP content array format.
    function ok(payload: unknown) {
      return {
        content: [{ type: 'text' as const, text: JSON.stringify(payload, null, 2) }],
      };
    }
  • The errResult() helper used in the catch block of konsulto_whoami to surface errors back to the MCP client.
    function errResult(err: unknown) {
      const message = err instanceof Error ? err.message : String(err);
      return {
        isError: true,
        content: [{ type: 'text' as const, text: `Error: ${message}` }],
      };
    }
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses the return values: user identity, tenant, role permissions, MCP token expiry, active audit pin. It implies a read-only operation with no side effects.

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?

Two sentences: first sentence states purpose, second gives usage guidance and output summary. No filler, front-loaded with key info.

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?

With no parameters and no output schema, the description fully explains what the tool does and what it returns. Ideal for a simple status/identity tool.

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 schema coverage is 100%. Description adds no param info (none needed), baseline 4 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 uses specific verbs ('Show who the MCP is acting as') and clearly identifies the resource (identity, permissions, audit config). It distinguishes from sibling tools that focus on audits, findings, assets, etc., by positioning this as a session orientation tool.

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?

Explicitly states 'Call this first in any session to orient yourself before performing actions.' Provides clear when-to-use context, but no explicit when-not or alternatives (though it's unique, so not necessary).

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/konsulto/konsulto-mcp'

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