We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Dsazz/mcp-confluence'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
import { PageError, PageNotFoundError } from "../../../shared/validators";
import type { PageRepository, PageSummary, PaginationInfo } from "../models";
import { PageId } from "../models";
/**
* Use case for getting child pages
*/
export class GetChildPagesUseCase {
constructor(private pageRepository: PageRepository) {}
async execute(
parentPageId: string,
options?: { limit?: number; start?: number },
): Promise<{ pages: PageSummary[]; pagination: PaginationInfo }> {
try {
const parentId = PageId.fromString(parentPageId);
// Check if parent page exists
const parentExists = await this.pageRepository.exists(parentId);
if (!parentExists) {
throw new PageNotFoundError(parentPageId);
}
return await this.pageRepository.findChildren(parentId, options);
} catch (error) {
if (error instanceof PageNotFoundError) {
throw error;
}
throw new PageError(
`Failed to retrieve child pages: ${error instanceof Error ? error.message : "Unknown error"}`,
parentPageId,
error,
);
}
}
}