Skip to main content
Glama
jagalliers

appd-mcp

by jagalliers

Get AppDynamics alerting configuration

appd_get_alerting_config

Retrieve all alerting configuration for an AppDynamics application, including health rules, policies, actions, and schedules, to inventory who gets notified and under what conditions.

Instructions

Composite read: parallel-fetches health rules + policies + actions + schedules for one application via the Alerting REST v1 API. Use this for "what alerts and to whom" inventories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
applicationYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
summaryYes
evidenceNo
entitiesYes
timeRangeNo
sourceEndpointsYes
paginationNo
warningsYes
truncatedYes

Implementation Reference

  • The tool registration and handler for 'appd_get_alerting_config'. It registers the tool with MCP server, resolves the application ID, then parallel-fetches health rules, policies, actions, and schedules from the Alerting REST v1 API with concurrency limit of 4, and returns the results in a structured envelope.
    export const getAlertingConfigTool: ToolRegistration = {
      name: 'appd_get_alerting_config',
      profile: 'read',
      register(server, services) {
        server.registerTool(
          'appd_get_alerting_config',
          {
            title: 'Get AppDynamics alerting configuration',
            description:
              'Composite read: parallel-fetches health rules + policies + actions + schedules for one application via the Alerting REST v1 API. Use this for "what alerts and to whom" inventories.',
            inputSchema: inputShape,
            outputSchema: envelopeOutputShape,
          },
          wrapHandler<{ application: AppRef }, AlertingConfigEvidence>(
            services.log,
            'appd_get_alerting_config',
            async (input) => {
              const appId = await services.alerting.resolveAppId(input.application);
              const limit = pLimit(4);
              const sourceEndpoints: string[] = [];
    
              const fetchList = async (segment: string): Promise<unknown[]> => {
                const path = `applications/${appId}/${segment}`;
                sourceEndpoints.push(`GET /controller/alerting/rest/v1/${path}`);
                const res = await services.alerting.get<unknown>(path);
                return Array.isArray(res.body) ? (res.body as unknown[]) : [];
              };
    
              const [healthRules, policies, actions, schedules] = await Promise.all([
                limit(() => fetchList('health-rules')),
                limit(() => fetchList('policies')),
                limit(() => fetchList('actions')),
                limit(() => fetchList('schedules')),
              ]);
    
              return toToolResult(
                buildEnvelope({
                  summary: `Alerting config for app ${appId}: ${healthRules.length} rules, ${policies.length} policies, ${actions.length} actions, ${schedules.length} schedules.`,
                  evidence: {
                    application: input.application,
                    applicationId: appId,
                    healthRules,
                    policies,
                    actions,
                    schedules,
                  } as AlertingConfigEvidence,
                  entities: [{ kind: 'application', id: appId }],
                  sourceEndpoints,
                }),
              );
            },
          ),
        );
      },
    };
  • Input schema for the tool: accepts an 'application' reference (either string name or numeric id).
    const inputShape = {
      application: appRefSchema,
    };
  • Central registration array that imports getAlertingConfigTool and includes it in the ALL_TOOLS array so it gets registered with the MCP server.
    export const ALL_TOOLS: ToolRegistration[] = [
      listApplicationsTool,
      getApplicationModelTool,
      getMetricHierarchyTool,
      queryMetricsTool,
      getTransactionSnapshotsTool,
      getHealthRuleViolationsTool,
      getAnomalyViolationsTool,
      getEventsTool,
      listHealthRulesTool,
      getAlertingConfigTool,
      queryAnalyticsEventsTool,
      getDependencyMapTool,
    ];
    
    export function registerAllTools(
      server: McpServer,
      services: Services,
    ): { registered: string[]; skipped: string[] } {
      return registerTools(server, services, ALL_TOOLS);
    }
  • Helper method in AlertingClient that resolves an application name or ID to a numeric ID, used by the tool handler to look up the application.
    async resolveAppId(appNameOrId: string | number): Promise<number> {
      if (typeof appNameOrId === 'number') return appNameOrId;
      const trimmed = appNameOrId.trim();
      if (/^\d+$/.test(trimmed)) return Number.parseInt(trimmed, 10);
    
      const cached = this.caches.appNameToId.get(trimmed);
      if (cached !== undefined) return cached;
    
      const res = await this.controller.get<AppListEntry[]>('applications');
      const list = Array.isArray(res.body) ? res.body : [];
    
      // Build a complete Map first. Do not look up via the LRU during/after
      // the iteration — if the response has more entries than `appNameToId.max`
      // (real tenants commonly have hundreds-to-thousands of apps), early
      // entries get evicted mid-loop and the post-iteration LRU.get() misses
      // even though the name was definitely in the response.
      // Verified bug repro on 2026-05-05 against an 841-app SaaS tenant.
      const fullIndex = new Map<string, number>();
      for (const app of list) {
        if (typeof app?.name === 'string' && typeof app?.id === 'number') {
          fullIndex.set(app.name, app.id);
        }
      }
    
      const found = fullIndex.get(trimmed);
      if (found === undefined) {
        throw new HttpError({
          kind: 'not_found',
          sourceEndpoint: 'GET /controller/rest/applications',
          message: `Application "${trimmed}" not found in this account`,
          hint: 'Pass a numeric application id, or verify the name with appd_list_applications.',
        });
      }
    
      // Best-effort write to the bounded LRU so subsequent same-name lookups
      // hit cache. The lookup result above is already authoritative regardless.
      this.caches.appNameToId.set(trimmed, found);
      return found;
Behavior3/5

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

No annotations are provided, so the description must carry the burden. It discloses that the tool performs parallel fetches and returns a composite of multiple sub-components, but does not mention read-onlyness, rate limits, or failure behavior.

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 with no wasted words. The key term 'composite read' is front-loaded, and the sentence is packed with actionable information.

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

Completeness4/5

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

Given the tool is a composite read with an output schema, the description adequately covers its scope and components. It could mention read-only nature, but overall it's complete for the complexity.

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

Parameters2/5

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

The schema description coverage is listed as 0%, meaning the description must compensate. However, the description only restates 'for one application' without adding parameter semantics beyond the schema's own minimal descriptions. The single parameter is only partially clarified.

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 'composite read' and specifies it fetches health rules, policies, actions, and schedules for one application via the Alerting REST v1 API. It distinguishes from siblings like appd_list_health_rules by indicating it is a wider inventory 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?

The phrase 'Use this for "what alerts and to whom" inventories' provides a clear use case. It implies it is more comprehensive than individual list endpoints, but does not explicitly state when not to use or name alternatives.

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