Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

get_current_user

Read-only

Retrieve details about the currently authenticated user from the Octopus Deploy API to verify identity and access permissions.

Instructions

Get information about the current authenticated user

This tool retrieves information about the currently authenticated user from the Octopus Deploy API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that implements the 'get_current_user' tool logic. It uses the shared client configuration helper to create an Octopus Deploy API client, fetches the current user details from the '/api/users/me' endpoint, maps the response fields to a clean object, and returns it as a text content block containing JSON.
    async () => {
      const configuration = getClientConfigurationFromEnvironment();
      const client = await Client.create(configuration);
    
      const user = await client.get<CurrentUser>("~/api/users/me");
    
      const currentUser = {
        id: user.Id,
        username: user.Username,
        displayName: user.DisplayName,
        isActive: user.IsActive,
        isService: user.IsService,
        emailAddress: user.EmailAddress,
        canPasswordBeEdited: user.CanPasswordBeEdited,
        isRequestor: user.IsRequestor,
      };
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(currentUser),
          },
        ],
      };
    }
  • The primary registration function for the 'get_current_user' tool. It calls server.tool() with the tool name, multi-line description, empty input schema object, output metadata (title and readOnlyHint), and the handler function.
    export function registerGetCurrentUserTool(server: McpServer) {
      server.tool(
        "get_current_user",
        `Get information about the current authenticated user
    
    This tool retrieves information about the currently authenticated user from the Octopus Deploy API.`,
        {},
        {
          title: "Get current user information",
          readOnlyHint: true,
        },
        async () => {
          const configuration = getClientConfigurationFromEnvironment();
          const client = await Client.create(configuration);
    
          const user = await client.get<CurrentUser>("~/api/users/me");
    
          const currentUser = {
            id: user.Id,
            username: user.Username,
            displayName: user.DisplayName,
            isActive: user.IsActive,
            isService: user.IsService,
            emailAddress: user.EmailAddress,
            canPasswordBeEdited: user.CanPasswordBeEdited,
            isRequestor: user.IsRequestor,
          };
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(currentUser),
              },
            ],
          };
        }
      );
    }
  • Self-registration of the tool definition into the global TOOL_REGISTRY. Specifies the tool name, configuration (toolset 'context', read-only), and the registration function to be called later by the index.ts registerTools.
    registerToolDefinition({
      toolName: "get_current_user",
      config: { toolset: "context", readOnly: true },
      registerFn: registerGetCurrentUserTool,
    });
  • TypeScript interface matching the structure of the user object returned by the Octopus Deploy API's '~/api/users/me' endpoint, used for type-safe API response handling.
    interface CurrentUser {
      Id: string;
      Username: string;
      DisplayName: string;
      IsActive: boolean;
      IsService: boolean;
      EmailAddress: string;
      CanPasswordBeEdited: boolean;
      IsRequestor: boolean;
    }
  • Import statement that triggers the execution of the registerToolDefinition in getCurrentUser.ts, adding it to the TOOL_REGISTRY for conditional registration during server setup.
    import './getCurrentUser.js';
Behavior3/5

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

Annotations provide readOnlyHint=true, indicating a safe read operation. The description adds context about retrieving from the Octopus Deploy API, which is useful but doesn't disclose additional behavioral traits like response format, error handling, or authentication requirements. No contradiction with annotations exists, but the description doesn't enrich beyond the basic safety profile.

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 front-loaded with the main purpose in the first sentence and adds clarifying context in the second. Both sentences earn their place by specifying the action and source. It's efficient but could be slightly more structured (e.g., bullet points aren't needed here).

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

Completeness3/5

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

Given 0 parameters, annotations with readOnlyHint, and no output schema, the description is adequate but minimal. It covers the basic purpose and source but lacks details on return values or error cases, which could be helpful for an agent despite the simple nature of the 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?

With 0 parameters and 100% schema description coverage, the baseline is 4 as per rules. The description doesn't need to add parameter details since there are none, and it appropriately avoids unnecessary information.

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 verb 'retrieves' and resource 'information about the currently authenticated user' with specific context 'from the Octopus Deploy API.' It distinguishes from siblings like get_account or get_tenant_by_id by focusing on the current user rather than other entities. However, it doesn't explicitly contrast with similar tools like get_account which might also return user-related data.

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

Usage Guidelines3/5

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

The description implies usage for getting current user info in the Octopus Deploy API context, but doesn't explicitly state when to use this vs. alternatives like get_account or list_accounts. No guidance on prerequisites (e.g., authentication required) or exclusions is provided, leaving usage context somewhat vague.

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/OctopusDeploy/mcp-server'

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