Get Log Sources
getLogSourcesRetrieve available log sources from PingOne Advanced Identity Cloud to identify data origins for log analysis.
Instructions
Retrieve the list of available log sources in PingOne AIC
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/logs/getLogSources.ts:9-28 (handler)The tool definition and handler function for 'getLogSources'. It makes an authenticated GET request to the AIC monitoring logs sources endpoint and returns the list of available log sources.
export const getLogSourcesTool = { name: 'getLogSources', title: 'Get Log Sources', description: 'Retrieve the list of available log sources in PingOne AIC', scopes: SCOPES, annotations: { readOnlyHint: true, openWorldHint: true }, async toolFunction() { const url = `https://${aicBaseUrl}/monitoring/logs/sources`; try { const { data, response } = await makeAuthenticatedRequest(url, SCOPES); return createToolResponse(formatSuccess(data, response)); } catch (error: any) { return createToolResponse(`Failed to fetch log sources: ${error.message}`); } } }; - src/index.ts:27-44 (registration)Registration of all tools (including getLogSources) via server.registerTool(). The tool is collected by getAllTools() via the logTools barrel export.
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); }); - src/utils/toolHelpers.ts:15-33 (helper)getAllTools() collects all tools from all categories including logTools (which contains getLogSourcesTool). This utility feeds the registration loop.
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; } - src/tools/logs/index.ts:2-3 (helper)Barrel export that re-exports getLogSourcesTool from the getLogSources module, making it discoverable by getAllTools().
export { getLogSourcesTool } from './getLogSources.js'; export { queryLogsTool } from './queryLogs.js'; - src/tools/logs/queryLogs.ts:21-25 (helper)Reference to getLogSources in the queryLogs tool's input schema description, guiding users to use getLogSources to discover available sources.
sources: z .array(z.string()) .describe( "Log sources to query (e.g., ['am-authentication', 'idm-activity']). IMPORTANT: use the getLogSources tool to determine available sources." ),