kibela_create_note
Create a note in Kibela by providing title and markdown content, with optional group, folder, author, coediting, and draft settings.
Instructions
Create a new note in Kibela.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | required: Title of the note | |
| content | Yes | required: Content of the note in markdown format | |
| groupIds | No | required: IDs of the groups to create the note in. | |
| folders | No | IDs of the folders to add the note to. | |
| authorId | No | ID of the author of the note. If not specified, the note will be created by the authenticated user. | |
| coediting | No | required: Whether to enable co-editing for the note | |
| draft | No | Whether to create the note as a draft |
Implementation Reference
- src/tools/createNote.ts:61-88 (handler)The handler function that executes the 'kibela_create_note' tool logic. It validates required args (title, content, groupIds, coediting), calls the GraphQL createNote mutation, and returns the response.
handler: async ({ title, content, groupIds, folders, authorId, coediting, draft }) => { if (!title || !content || !groupIds || !coediting) { throw new Error('Title, content, groupIds, and coediting are required') } const response = await createNote({ input: { clientMutationId: uuid(), title, content, groupIds, folders, authorId, coediting, draft, }, }) return { content: [ { type: 'text', text: JSON.stringify(response.createNote, null, 2), }, ], } }, } - src/tools/createNote.ts:5-59 (schema)Type definition (CreateNoteArgs) and inputSchema for the tool, specifying required fields (title, content) and optional fields (groupIds, folders, authorId, coediting, draft).
export type CreateNoteArgs = { title: string content: string groupIds: string[] coediting: boolean folders?: string[] authorId?: string draft?: boolean } export const createNoteTool: ToolDefinition<CreateNoteArgs> = { tool: { name: 'kibela_create_note', description: 'Create a new note in Kibela.', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'required: Title of the note', }, content: { type: 'string', description: 'required: Content of the note in markdown format', }, groupIds: { type: 'array', items: { type: 'string', }, description: 'required: IDs of the groups to create the note in.', }, folders: { type: 'array', items: { type: 'string', }, description: 'IDs of the folders to add the note to.', }, authorId: { type: 'string', description: 'ID of the author of the note. If not specified, the note will be created by the authenticated user.', }, coediting: { type: 'boolean', description: 'required: Whether to enable co-editing for the note', }, draft: { type: 'boolean', description: 'Whether to create the note as a draft', }, }, required: ['title', 'content'], }, - src/tools/index.ts:15-16 (registration)Registration of 'kibela_create_note' tool in the toolDefinitions map, mapping the tool name to the createNoteTool definition.
kibela_create_note: createNoteTool, } as const - GraphQL mutation definition and helper function that sends the CreateNote mutation via gqlRequest.
import { TypedDocumentNode } from '@graphql-typed-document-node/core' import { gql } from 'graphql-tag' import { gqlRequest } from '../request' type CreateNoteResponse = { createNote: { clientMutationId: string note: { id: string title: string content: string url: string } } } type CreateNoteVariables = { input: { clientMutationId: string title: string content: string coediting: boolean groupIds: string[] folders?: string[] authorId?: string draft?: boolean } } const createNoteMutation: TypedDocumentNode<CreateNoteResponse, CreateNoteVariables> = gql` mutation CreateNote($input: CreateNoteInput!) { createNote(input: $input) { clientMutationId note { id title content url } } } ` export async function createNote(variables: CreateNoteVariables): Promise<CreateNoteResponse> { return gqlRequest(createNoteMutation, variables) } - src/tools/index.ts:20-20 (registration)TOOLS array export that includes the tool definition (name + schema) for MCP protocol registration.
export const TOOLS = Object.values(toolDefinitions).map((def) => def.tool)