Bahn: aisupport, Analyse-O2C-C2S, awesome-bahn-mcp-servers, beam-mcp,
Confluence_Bot, db-planet-mcp-server, O2C-Harness, project-audit,
Projekt-KIQ-HP, teamlandkarte-mcp
Dhive: Jury-Voting
Privat: CV, NoteGraph (NOTE: NoteGraph needs complete redo after consolidation)
Shared: AI-Orchestrator, OrgMyLife, power_skills_and_more
Shared/references: symphony (read-only)
Bahn repos remain available as independent remotes - this monorepo
pulls them in via subtree, the originals are untouched.
12 KiB
Requirements Document
Introduction
This document specifies the requirements for refactoring the DB Planet MCP Server from a single monolithic tool (SearchDBPlanet) into a suite of focused, single-responsibility MCP tools. The current server exposes one tool that combines search and full content fetching. The refactored server will expose ~27 tools organized across 8 capability areas, enabling AI agents to select the right tool for each task with clear inputs and outputs.
Glossary
- MCP_Server: The Model Context Protocol server that registers and exposes tools to AI agents via the StreamableHTTP transport
- Tool: A single MCP tool registered on the MCP_Server with a unique name, description, input schema, and handler function
- HaiiloClient: The API client class responsible for authenticating with the Haiilo platform via OAuth2 and making HTTP requests
- Tool_Registry: The module that registers all tools on the MCP_Server instance, organized by capability area
- Capability_Area: A logical grouping of related tools (e.g., Search, Workspaces, People)
- Haiilo_API: The REST API exposed by the Haiilo (DB Planet) platform
Requirements
Requirement 1: Shared API Client Infrastructure
User Story: As a developer, I want all tools to share a single authenticated HaiiloClient instance per session, so that OAuth2 tokens are reused and connection setup is not duplicated.
Acceptance Criteria
- THE MCP_Server SHALL create one HaiiloClient instance per session and share it across all registered tools
- THE HaiiloClient SHALL cache the OAuth2 access token after the first successful authentication and reuse it for subsequent API calls within the same session
- IF the HaiiloClient receives a 401 response from the Haiilo_API, THEN THE HaiiloClient SHALL re-authenticate and retry the request once
- IF required credentials are missing, THEN THE Tool SHALL return an MCP error response with a descriptive message
Requirement 2: Tool Registration Architecture
User Story: As a developer, I want tools organized into separate registration modules by capability area, so that the codebase is maintainable and each area can evolve independently.
Acceptance Criteria
- THE Tool_Registry SHALL organize tool registration functions into separate modules, one per Capability_Area
- THE MCP_Server SHALL register all tools from all Capability_Area modules during server initialization
- THE Tool_Registry SHALL assign each Tool a unique, descriptive name following the pattern
{Area}_{Action}(e.g.,Search_FullText,Workspace_List) - THE Tool_Registry SHALL provide each Tool with a description that explains the tool's purpose, expected inputs, and output format
- THE Tool_Registry SHALL define each Tool's input schema using Zod validation with descriptive parameter annotations
Requirement 3: Information Discovery and Search Tools
User Story: As an AI agent, I want separate search tools for full-text search, quick entity lookup, and grouped search, so that I can choose the right search strategy for each query.
Acceptance Criteria
- WHEN a full-text search query is provided, THE Search_FullText Tool SHALL call GET /api/search with the query term and return the list of search results with metadata (id, title, type, excerpt, modified date)
- WHEN a full-text search query is provided, THE Search_FullText Tool SHALL accept optional pagination parameters (page number, page size)
- WHEN a quick entity search query is provided, THE Search_QuickEntity Tool SHALL call GET /api/quick-entity-search with the query and return matching entities
- WHEN a grouped search query is provided, THE Search_Grouped Tool SHALL call GET /api/search/grouped with the query and return results organized by content type
- THE Search_FullText Tool SHALL return result metadata only, without fetching full content for each result
Requirement 4: Workspace Management Tools
User Story: As an AI agent, I want tools to list, inspect, join, and create workspaces, so that I can help users manage their workspace memberships and discover workspace content.
Acceptance Criteria
- WHEN workspace listing is requested, THE Workspace_List Tool SHALL call GET /api/workspaces and return the list of available workspaces
- WHEN a workspace ID is provided, THE Workspace_Get Tool SHALL call GET /api/workspaces/{id} and return the workspace details including name, description, and settings
- WHEN a workspace ID is provided, THE Workspace_GetMembers Tool SHALL call GET /api/workspaces/{id}/members and return the list of workspace members
- WHEN a workspace ID is provided, THE Workspace_Join Tool SHALL call PUT /api/workspaces/{id}/members/join to add the current user as a member of the workspace
- WHEN workspace creation parameters are provided, THE Workspace_Create Tool SHALL call POST /api/workspaces with the provided name and description to create a new workspace
Requirement 5: News and Content Tools
User Story: As an AI agent, I want a tool to retrieve the news feed, so that I can help users stay informed about recent company news and blog posts.
Acceptance Criteria
- WHEN the news feed is requested, THE News_GetFeed Tool SHALL call GET /web/blog/newsfeed and return the list of recent news items
- THE News_GetFeed Tool SHALL accept optional pagination parameters (page number, page size)
- THE News_GetFeed Tool SHALL return each news item with its title, author, publication date, and excerpt
Requirement 6: People Directory Tools
User Story: As an AI agent, I want tools to look up the current user's profile, list users, and search for people, so that I can help users find colleagues and retrieve profile information.
Acceptance Criteria
- WHEN the current user's profile is requested, THE People_GetMe Tool SHALL call GET /api/users/me and return the authenticated user's profile information
- WHEN a user listing is requested, THE People_List Tool SHALL call GET /api/users and return a paginated list of users
- WHEN a people search query is provided, THE People_Search Tool SHALL call GET /api/users/chooser/search with the query and return matching user profiles
- THE People_List Tool SHALL accept optional pagination parameters (page number, page size)
Requirement 7: Event Discovery Tools
User Story: As an AI agent, I want tools to view event details, check memberships, update attendance status, and create events, so that I can help users manage their event participation.
Acceptance Criteria
- WHEN an event ID is provided, THE Event_Get Tool SHALL call GET /api/events/{id} and return the event details including title, description, date, and location
- WHEN an event ID is provided, THE Event_GetMemberships Tool SHALL call GET /api/events/{id}/memberships and return the list of event attendees and their statuses
- WHEN an event ID and attendance status are provided, THE Event_UpdateStatus Tool SHALL call PUT /api/events/{id}/memberships/status to update the current user's attendance status
- WHEN event creation parameters are provided, THE Event_Create Tool SHALL call POST /api/events with the provided details to create a new event
Requirement 8: Social Engagement Tools
User Story: As an AI agent, I want tools to read and post comments and manage likes, so that I can help users engage with content on the platform.
Acceptance Criteria
- WHEN a target entity ID is provided, THE Social_GetComments Tool SHALL call GET /api/comments with the target ID and return the list of comments
- WHEN a comment body and target entity ID are provided, THE Social_PostComment Tool SHALL call POST /api/comments to create a new comment on the target entity
- WHEN a like target ID is provided, THE Social_GetLikes Tool SHALL call GET /api/like-targets/{targetType}/{targetId} and return the like count and whether the current user has liked the target
- WHEN a like target ID is provided, THE Social_ToggleLike Tool SHALL call POST /api/like-targets/{targetType}/{targetId}/likes/{userId} to toggle the current user's like on the target
Requirement 9: Notification Tools
User Story: As an AI agent, I want tools to retrieve notifications, check notification status, and mark notifications as seen, so that I can help users stay on top of platform activity.
Acceptance Criteria
- WHEN notifications are requested, THE Notification_List Tool SHALL call GET /api/notifications and return the list of notifications with their read/unread status
- THE Notification_List Tool SHALL accept optional pagination parameters (page number, page size)
- WHEN notification status is requested, THE Notification_GetStatus Tool SHALL call GET /api/notifications/status and return the count of unseen notifications
- WHEN a mark-seen request is made, THE Notification_MarkSeen Tool SHALL call PUT /api/notifications/mark-seen to mark all notifications as seen
Requirement 10: Page Management Tools
User Story: As an AI agent, I want tools to list, view, inspect members of, and create pages, so that I can help users manage intranet page content.
Acceptance Criteria
- WHEN page listing is requested, THE Page_List Tool SHALL call GET /api/pages and return the list of available pages
- WHEN a page ID or slug is provided, THE Page_Get Tool SHALL call GET /api/pages/{id} and return the page details including title, content widgets, and metadata
- WHEN a page ID is provided, THE Page_GetMembers Tool SHALL call GET /api/pages/{id}/members and return the list of page members and their roles
- WHEN page creation parameters are provided, THE Page_Create Tool SHALL call POST /api/pages with the provided title and content to create a new page
Requirement 11: Content Fetching Tool
User Story: As an AI agent, I want a dedicated tool to fetch the full rendered content of a specific item by its ID and type, so that I can retrieve detailed content on demand after discovering items via search.
Acceptance Criteria
- WHEN a content ID and content type are provided, THE Content_GetFull Tool SHALL fetch the full rendered content for the specified item using the appropriate Haiilo widget API endpoint
- THE Content_GetFull Tool SHALL support blog articles, wiki articles, pages, workspaces, apps, and timeline items as content types
- THE Content_GetFull Tool SHALL extract text from widget HTML and return clean, readable text
- IF the content type is not recognized, THEN THE Content_GetFull Tool SHALL return an error indicating the unsupported content type
- IF the content cannot be fetched, THEN THE Content_GetFull Tool SHALL return an error with a descriptive message
Requirement 12: Error Handling Consistency
User Story: As a developer, I want all tools to handle errors in a consistent manner, so that AI agents receive predictable error responses regardless of which tool is called.
Acceptance Criteria
- IF a tool receives a 401 Unauthorized response from the Haiilo_API, THEN THE Tool SHALL return an MCP error response indicating authentication failure
- IF a tool receives a 403 Forbidden response from the Haiilo_API, THEN THE Tool SHALL return an MCP error response indicating insufficient permissions
- IF a tool receives a 404 Not Found response from the Haiilo_API, THEN THE Tool SHALL return an MCP error response indicating the requested resource was not found
- IF a tool encounters a network timeout, THEN THE Tool SHALL return an MCP error response indicating a timeout occurred
- THE Tool SHALL include the HTTP status code and a human-readable message in all error responses
Requirement 13: Backward Compatibility
User Story: As a developer, I want the refactored server to maintain the same transport and authentication mechanism, so that existing clients can connect without changes.
Acceptance Criteria
- THE MCP_Server SHALL continue to use the StreamableHTTP transport on the /servers/dbplanet/mcp endpoint
- THE MCP_Server SHALL continue to accept credentials via the x-dbplanet-* HTTP headers
- THE MCP_Server SHALL continue to listen on port 3000
- THE MCP_Server SHALL continue to expose the /health endpoint returning a 200 status