Skip to main content
Glama
kj455
by kj455
updateNoteContent.ts1.96 kB
import { getNote } from '../graphql' import { updateNoteContent } from '../graphql/queries/updateNoteContent' import { uuid } from '../utils' import { ToolDefinition } from './types' export type UpdateNoteContentArgs = { id: string content: string } export const updateNoteContentTool: ToolDefinition<UpdateNoteContentArgs> = { tool: { name: 'kibela_update_note_content', description: 'Update note content by note id. This tool allows you to modify the content of an existing Kibela note. Before updating, it fetches the current content of the note to ensure proper version control. Note that you need the note ID (not the note path) to use this tool.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Note id - not note path (e.g. /notes/123). If you want to update note content by note path, please use kibela_get_note_from_path tool first and get note id from the response', }, content: { type: 'string', description: 'New content of the note in markdown format. The content will completely replace the existing note content. Make sure to include all necessary formatting, headers, and sections you want to preserve.', }, }, required: ['id', 'content'], }, }, handler: async ({ id, content }) => { if (!id || !content) { throw new Error('Note id and content are required') } const noteRes = await getNote({ id }) if (!noteRes.note) { throw new Error('Note not found') } const response = await updateNoteContent({ input: { clientMutationId: uuid(), id, newContent: content, baseContent: noteRes.note.content, }, }) return { content: [ { type: 'text', text: JSON.stringify(response.updateNoteContent, null, 2), }, ], } }, }

Implementation Reference

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/kj455/mcp-kibela'

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