Skip to main content
Glama
jagalliers

appd-mcp

by jagalliers

List AppDynamics applications

appd_list_applications

Retrieve business applications visible to the API client, with an optional filter for apps active within the last N minutes (SaaS only).

Instructions

List business applications visible to the configured API Client. Optionally filter to apps that have been "alive" in the last N minutes (SaaS only).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aliveWithinMinutesNoSaaS-only: filter to applications that have been alive within the last N minutes (uses time-range-type=BEFORE_NOW). Omit to list all.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
summaryYes
evidenceNo
entitiesYes
timeRangeNo
sourceEndpointsYes
paginationNo
warningsYes
truncatedYes

Implementation Reference

  • Main tool handler for 'appd_list_applications'. Registers the tool with MCP server, calls GET /controller/rest/applications, populates appNameToId cache, and returns a response envelope with application entities.
    export const listApplicationsTool: ToolRegistration = {
      name: 'appd_list_applications',
      profile: 'read',
      register(server, services) {
        server.registerTool(
          'appd_list_applications',
          {
            title: 'List AppDynamics applications',
            description:
              'List business applications visible to the configured API Client. Optionally filter to apps that have been "alive" in the last N minutes (SaaS only).',
            inputSchema: inputShape,
            outputSchema: envelopeOutputShape,
          },
          wrapHandler<{ aliveWithinMinutes?: number | undefined }, AppListEvidence>(
            services.log,
            'appd_list_applications',
            async (input) => {
              const query: Record<string, string | number> = {};
              if (input.aliveWithinMinutes !== undefined) {
                query['time-range-type'] = 'BEFORE_NOW';
                query['duration-in-mins'] = input.aliveWithinMinutes;
              }
              const res = await services.controller.get<AppDApp[]>('applications', query);
              const apps = Array.isArray(res.body) ? res.body : [];
    
              for (const app of apps) {
                if (typeof app.name === 'string' && typeof app.id === 'number') {
                  services.caches.appNameToId.set(app.name, app.id);
                }
              }
    
              const entities: EnvelopeEntity[] = apps
                .filter((a): a is AppDApp & { id: number } => typeof a.id === 'number')
                .map((a) => ({
                  kind: 'application',
                  id: a.id,
                  ...(a.name !== undefined ? { name: a.name } : {}),
                }));
    
              const evidence: AppListEvidence = {
                count: apps.length,
                applications: apps.map((a) => ({
                  id: a.id,
                  name: a.name,
                  description: a.description,
                  accountGuid: a.accountGuid,
                })),
              };
    
              return toToolResult(
                buildEnvelope({
                  summary: `Found ${apps.length} application${apps.length === 1 ? '' : 's'}.`,
                  evidence,
                  entities,
                  sourceEndpoints: ['GET /controller/rest/applications'],
                }),
              );
            },
          ),
        );
      },
    };
  • Input schema: optional 'aliveWithinMinutes' integer to filter SaaS applications alive within N minutes.
    const inputShape = {
      aliveWithinMinutes: z
        .number()
        .int()
        .positive()
        .optional()
        .describe(
          'SaaS-only: filter to applications that have been alive within the last N minutes (uses time-range-type=BEFORE_NOW). Omit to list all.',
        ),
    };
  • Imports listApplicationsTool and includes it in the ALL_TOOLS array at line 19.
    import { listApplicationsTool } from './listApplications.js';
  • ToolRegistration interface that defines the shape of tool registrations, including name 'appd_list_applications'.
    export interface ToolRegistration {
      /** Public tool name, e.g. "appd_list_applications" */
      name: string;
      /** Stable profile, used for future allowlists in Phase 2/3 */
      profile: 'read' | 'sensitive-read' | 'change';
      /**
       * Function that calls McpServer#registerTool with name, config, and handler.
       * Implementations must use registerTool (not the deprecated tool() overloads).
       */
      register: (server: McpServer, services: Services) => void;
    }
  • wrapHandler utility that wraps the tool handler with error handling for HttpErrors and unexpected exceptions.
    export function wrapHandler<I, R>(
      log: Logger,
      toolName: string,
      handler: (input: I) => Promise<DualToolResult<R>>,
    ): (input: I) => Promise<DualToolResult<R> | (DualToolResult<R> & { isError: true })> {
      return async (input) => {
        try {
          return await handler(input);
        } catch (err) {
          if (err instanceof HttpError) {
            log.warn(
              {
                tool: toolName,
                kind: err.kind,
                statusCode: err.statusCode,
                sourceEndpoint: err.sourceEndpoint,
              },
              'tool: HttpError',
            );
            return toErrorResult({
              summary:
                `${toolName} failed: ${err.kind}${err.statusCode ? ` (HTTP ${err.statusCode})` : ''}. ${err.hint ?? ''}`.trim(),
              evidence: { kind: err.kind, message: err.message, hint: err.hint } as unknown as R,
              sourceEndpoints: [err.sourceEndpoint],
            });
          }
          log.error({ tool: toolName, err }, 'tool: unexpected error');
          const message = err instanceof Error ? err.message : String(err);
          return toErrorResult({
            summary: `${toolName} failed: unexpected error: ${message}`,
            evidence: { kind: 'internal', message } as unknown as R,
          });
        }
Behavior3/5

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

With no annotations, the description carries full burden. It states the tool lists business applications visible to the configured API Client and adds the 'aliveWithinMinutes' filter is SaaS-only. However, it does not clarify behavior if the filter is used on non-SaaS deployments or other traits like pagination.

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 extremely concise with only two sentences, front-loading the main purpose and filter option. No unnecessary words.

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?

For a simple tool with one optional parameter and an output schema (not shown), the description is complete. It explains what the tool lists and the optional filter, leaving return format to the output schema.

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?

Schema coverage is 100%, and the description adds minimal meaning beyond the schema which already describes the parameter as 'SaaS-only: filter...'. The description essentially repeats the schema description, so no significant additional value.

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 clearly states the verb 'List business applications visible to the configured API Client' and specifies the optional filter for 'alive' applications. This distinguishes it from sibling tools like appd_get_application_model which focuses on a specific application.

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 that the filter is optional and SaaS-only, providing clear context for when to use it. However, it does not explicitly state when not to use this tool or mention alternatives for other use cases.

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/jagalliers/appd-mcp'

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