Skip to main content
Glama
pingidentity

PingOne Advanced Identity Cloud MCP Server

Official
by pingidentity

Get Journey Preview URL

getJourneyPreviewUrl
Read-only

Generate a preview URL for testing an authentication journey. Returns a browser-ready URL to validate journey flow.

Instructions

Generate the preview URL for testing an authentication journey. Returns a URL that can be opened in a browser to test the journey flow.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
realmYesThe realm containing the journey
journeyNameNoThe name of the journey to preview. If omitted, returns the URL for the default journey.

Implementation Reference

  • The main implementation file for the 'getJourneyPreviewUrl' tool. It defines the tool object with name, title, description, inputSchema (realm + optional journeyName), and the toolFunction handler that builds a preview URL for testing authentication journeys.
    import { z } from 'zod';
    import { createToolResponse } from '../../utils/apiHelpers.js';
    import { REALMS, safePathSegmentSchema } from '../../utils/validationHelpers.js';
    
    const aicBaseUrl = process.env.AIC_BASE_URL;
    
    export const getJourneyPreviewUrlTool = {
      name: 'getJourneyPreviewUrl',
      title: 'Get Journey Preview URL',
      description:
        'Generate the preview URL for testing an authentication journey. Returns a URL that can be opened in a browser to test the journey flow.',
      scopes: [],
      annotations: {
        readOnlyHint: true
      },
      inputSchema: {
        realm: z.enum(REALMS).describe('The realm containing the journey'),
        journeyName: safePathSegmentSchema
          .optional()
          .describe('The name of the journey to preview. If omitted, returns the URL for the default journey.')
      },
      async toolFunction({ realm, journeyName }: { realm: string; journeyName?: string }) {
        // Build the base URL
        let previewUrl = `https://${aicBaseUrl}/am/XUI/?realm=/${realm}`;
    
        // Add journey-specific parameters if a journey name is provided
        if (journeyName) {
          const encodedJourneyName = encodeURIComponent(journeyName);
          previewUrl += `&authIndexType=service&authIndexValue=${encodedJourneyName}`;
        }
    
        const result = {
          realm,
          journeyName: journeyName || '(default)',
          previewUrl
        };
    
        return createToolResponse(JSON.stringify(result, null, 2));
      }
    };
  • Input schema using Zod: realm must be one of the REALMS enum ('alpha' or 'bravo'), and journeyName is optional and validated via safePathSegmentSchema to prevent path traversal.
    inputSchema: {
      realm: z.enum(REALMS).describe('The realm containing the journey'),
      journeyName: safePathSegmentSchema
        .optional()
        .describe('The name of the journey to preview. If omitted, returns the URL for the default journey.')
    },
  • src/index.ts:27-44 (registration)
    General tool registration loop: iterates over all tools (including getJourneyPreviewUrlTool) and registers each with the MCP server using server.registerTool(tool.name, toolConfig, tool.toolFunction).
    allTools.forEach((tool) => {
      const toolConfig: ToolConfig = {
        title: tool.title,
        description: tool.description
      };
    
      // Only add inputSchema if it exists (some tools like getLogSources don't have one)
      if ('inputSchema' in tool && tool.inputSchema) {
        toolConfig.inputSchema = tool.inputSchema;
      }
    
      // Add annotations if present
      if ('annotations' in tool && tool.annotations) {
        toolConfig.annotations = tool.annotations;
      }
    
      server.registerTool(tool.name, toolConfig, tool.toolFunction as any);
    });
  • getAllTools collects all tools from all categories. AM tools (including getJourneyPreviewUrlTool) are included via the amTools module export when not in Docker mode.
    export function getAllTools(): Tool[] {
      const isDockerMode = process.env.DOCKER_CONTAINER === 'true';
    
      const tools: Tool[] = [
        ...(Object.values(managedObjectTools) as Tool[]),
        ...(Object.values(logTools) as Tool[]),
        ...(Object.values(themeTools) as Tool[]),
        ...(Object.values(esvTools) as Tool[]),
        ...(Object.values(featureManagementTools) as Tool[])
      ];
    
      // Only include AM tools in non-Docker mode (requires browser-based PKCE auth)
      if (!isDockerMode) {
        tools.push(...(Object.values(amTools) as Tool[]));
        tools.push(...(Object.values(applicationTools) as Tool[]));
      }
    
      return tools;
    }
  • createToolResponse helper function that formats the tool's return value into the standard MCP response format with text content.
    export function createToolResponse(text: string) {
      return {
        content: [
          {
            type: 'text' as const,
            text
          }
        ]
      };
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true, and the description adds that the tool generates a URL for browser testing, implying safety. However, it does not disclose additional behavioral traits like whether the URL expires or requires special permissions.

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 concise with two sentences, no redundant information, and front-loads the core action and purpose effectively.

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's simplicity and the annotations covering its read-only nature, the description is mostly complete. However, it lacks details about the output URL format or any state changes, but these are not critical for this tool.

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?

The input schema already provides complete descriptions for both parameters (realm and journeyName) with 100% coverage. The description adds no parameter-specific meaning beyond 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?

The description clearly states the tool generates a preview URL for testing an authentication journey, using a specific verb and resource, and it distinguishes itself from sibling tools like getJourney or updateJourney by focusing on URL generation.

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 the tool is for testing authentication journeys, providing clear context, but it does not explicitly state when not to use it or suggest alternatives, leaving some ambiguity.

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