Skip to main content
Glama
marco-looy
by marco-looy
get-data-objects.js2.01 kB
import { BaseTool } from '../../registry/base-tool.js'; import { getSessionCredentialsSchema } from '../../utils/tool-schema.js'; export class GetDataObjectsTool extends BaseTool { /** * Get the category this tool belongs to */ static getCategory() { return 'dataviews'; } /** * Get tool definition for MCP protocol */ static getDefinition() { return { name: 'get_data_objects', description: 'Retrieve list of available data objects with metadata and HATEOAS links. Can optionally filter by data object type (data or case).', inputSchema: { type: 'object', properties: { type: { type: 'string', enum: ['data', 'case'], description: 'Filter for data object type. Returns "data" or "case" type objects.' }, sessionCredentials: getSessionCredentialsSchema() }, required: [] } }; } /** * Execute the get data objects operation */ async execute(params) { const { type } = params; let sessionInfo = null; try { sessionInfo = this.initializeSessionConfig(params); // Validate enum parameters if provided const enumValidation = this.validateEnumParams(params, { type: ['data', 'case'] }); if (enumValidation) { return enumValidation; } // Execute with standardized error handling return await this.executeWithErrorHandling( `Data Objects List${type ? ` (type: ${type})` : ''}`, async () => await this.pegaClient.getDataObjects({ type }), { sessionInfo } ); } catch (error) { return { content: [{ type: 'text', text: `## Error: Data Objects List${type ? ` (type: ${type})` : ''}\n\n**Unexpected Error**: ${error.message}\n\n${sessionInfo ? `**Session**: ${sessionInfo.sessionId} (${sessionInfo.authMode} mode)\n` : ''}*Error occurred at: ${new Date().toISOString()}*` }] }; } } }

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/marco-looy/pega-dx-mcp'

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