kibela_get_group_folders
Get folders in a specified Kibela group by group ID and optional parent folder ID to navigate the group's folder hierarchy.
Instructions
Get folders in a group
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groupId | Yes | Group ID | |
| parentFolderId | No | Parent folder ID |
Implementation Reference
- src/kibela.ts:442-493 (handler)Handler for kibela_get_group_folders. Extracts groupId and optional parentFolderId from args, executes a GraphQL query (GetGroupFolders) to fetch folders (with nested notes) for the given group, and returns the result.
case "kibela_get_group_folders": { const { groupId, parentFolderId } = args as { groupId: string; parentFolderId?: string; }; const operation = ` query GetGroupFolders($groupId: ID!, $parentFolderId: ID) { group(id: $groupId) { folders(first: 30, active: true, parentFolderId: $parentFolderId) { nodes { id name fullName path canBeManaged parent { id name } notes(first: 10, active: true, orderBy: { field: CONTENT_UPDATED_AT, direction: DESC }) { nodes { id title contentUpdatedAt publishedAt author { account realName } } } } } } } `; const response = await client.request<GroupFoldersResponse>(operation, { groupId, parentFolderId, }); return { content: [ { type: "text", text: JSON.stringify(response.group.folders.nodes, null, 2), }, ], }; } - src/kibela.ts:86-96 (schema)Tool definition for kibela_get_group_folders. Defines inputSchema with groupId (required) and parentFolderId (optional).
const GET_GROUP_FOLDERS_TOOL: Tool = { name: "kibela_get_group_folders", description: "Get folders in a group", inputSchema: { type: "object", properties: { groupId: { type: "string", description: "Group ID" }, parentFolderId: { type: "string", description: "Parent folder ID" }, }, required: ["groupId"], }, - src/types.ts:103-113 (schema)Type definition for GroupFoldersResponse, representing the shape of the GraphQL response (group with folders containing notes).
export interface GroupFoldersResponse { group: { folders: { nodes: (KibelaFolder & { notes: { nodes: KibelaNote[]; }; })[]; }; }; } - src/kibela.ts:206-220 (registration)Tool registration via ListToolsRequestSchema handler, where GET_GROUP_FOLDERS_TOOL (line 212) is included in the list of available tools.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ SEARCH_NOTES_TOOL, GET_MY_NOTES_TOOL, GET_NOTE_CONTENT_TOOL, GET_GROUPS_TOOL, GET_GROUP_FOLDERS_TOOL, GET_GROUP_NOTES_TOOL, GET_FOLDER_NOTES_TOOL, GET_USERS_TOOL, LIKE_NOTE_TOOL, UNLIKE_NOTE_TOOL, GET_RECENTLY_VIEWED_NOTES_TOOL, GET_NOTE_FROM_PATH_TOOL, ],