Skip to main content
Glama
pingidentity

PingOne Advanced Identity Cloud MCP Server

Official
by pingidentity

Set Default Theme

setDefaultTheme
Idempotent

Assign a theme as the default for a realm to apply it to all authentication experiences.

Instructions

Set a theme as the default for a realm in PingOne AIC

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
realmYesRealm name
themeIdentifierYesTheme ID or name

Implementation Reference

  • Main handler for the setDefaultTheme tool. Fetches theme configuration from PingOne AIC, finds the theme by ID/name, sets all themes' isDefault to false except the target, and PUTs the updated config back.
    export const setDefaultThemeTool = {
      name: 'setDefaultTheme',
      title: 'Set Default Theme',
      description: 'Set a theme as the default for a realm in PingOne AIC',
      scopes: SCOPES,
      annotations: {
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: true
      },
      inputSchema: {
        realm: z.enum(REALMS).describe('Realm name'),
        themeIdentifier: safePathSegmentSchema.describe('Theme ID or name')
      },
      async toolFunction({ realm, themeIdentifier }: { realm: string; themeIdentifier: string }) {
        try {
          // Get the current theme configuration
          const configUrl = `https://${aicBaseUrl}/openidm/config/ui/themerealm`;
          const { data: config } = await makeAuthenticatedRequest(configUrl, SCOPES);
    
          // Validate config structure
          if (!config || !(config as any).realm || !(config as any).realm[realm]) {
            return createToolResponse(`Invalid theme configuration structure for realm "${realm}"`);
          }
    
          const realmThemes = (config as any).realm[realm];
    
          // Find the theme by ID or name
          const themeIndex = realmThemes.findIndex((t: any) => t._id === themeIdentifier || t.name === themeIdentifier);
    
          if (themeIndex === -1) {
            return createToolResponse(`Theme not found: "${themeIdentifier}" in realm "${realm}"`);
          }
    
          const targetTheme = realmThemes[themeIndex];
          const themeName = targetTheme.name;
          const themeId = targetTheme._id;
    
          // Check if it's already the default
          if (targetTheme.isDefault === true) {
            return createToolResponse(`Theme "${themeName}" is already the default theme for realm "${realm}"`);
          }
    
          // Set all themes to isDefault: false, then set target to true
          const updatedThemes = realmThemes.map((theme: any, index: number) => ({
            ...theme,
            isDefault: index === themeIndex
          }));
    
          // Update the config
          const updatedConfig = {
            ...config,
            realm: {
              ...(config as any).realm,
              [realm]: updatedThemes
            }
          };
    
          // PUT the updated configuration back
          const { response } = await makeAuthenticatedRequest(configUrl, SCOPES, {
            method: 'PUT',
            body: JSON.stringify(updatedConfig)
          });
    
          const successMessage = `Set theme "${themeName}" (${themeId}) as default for realm "${realm}"`;
          return createToolResponse(
            formatSuccess({ _id: themeId, name: themeName, isDefault: true, message: successMessage }, response)
          );
        } catch (error: any) {
          return createToolResponse(`Failed to set default theme in realm "${realm}": ${error.message}`);
        }
      }
    };
  • Input schema for setDefaultTheme: requires a realm (alpha or bravo) and a themeIdentifier (ID or name, validated for safe URL path usage).
    inputSchema: {
      realm: z.enum(REALMS).describe('Realm name'),
      themeIdentifier: safePathSegmentSchema.describe('Theme ID or name')
    },
  • Re-exports the setDefaultThemeTool from the themes barrel index file.
    export { setDefaultThemeTool } from './setDefaultTheme.js';
  • Schema documentation noting isDefault is controlled via setDefaultTheme tool.
    systemControlledFields: {
      _id: 'Auto-generated UUID (do not provide on create)',
      isDefault: 'Controlled via setDefaultTheme tool (always false on create)'
    },
Behavior3/5

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

Annotations already indicate non-destructive and idempotent behavior. The description adds no further behavioral context beyond the basic action, which is acceptable but minimal.

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?

Single sentence, 14 words, no fluff. Efficiently communicates the tool's purpose.

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 simple tool (2 parameters, no output schema, good annotations), the description is adequate. It covers the core purpose, though no mention of side effects or return value, but that's acceptable.

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?

Input schema provides 100% coverage with descriptions and an enum for realm. The description does not add any extra meaning beyond what is already in the schema.

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 clearly states the action: setting a theme as default for a realm. It uses specific verb and resource, and distinguishes from sibling tools like createTheme or updateTheme.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives, no prerequisites, and no exclusions. The description is silent on context.

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

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