Skip to main content
Glama
kj455

MCP Kibela

by kj455

kibela_update_note_content

Update an existing Kibela note's content using its note ID. Fetches current content for version control and replaces it entirely with new markdown content.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesNote 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
contentYesNew 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.

Implementation Reference

  • The handler function that executes the tool logic: validates id and content, fetches the current note via getNote to obtain baseContent for version control, then calls updateNoteContent mutation with clientMutationId, id, newContent, and baseContent. Returns the mutation response as JSON.
      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),
            },
          ],
        }
      },
    }
  • Type definition (UpdateNoteContentArgs) and inputSchema for the tool: requires 'id' (string, the note ID) and 'content' (string, the new markdown content). The inputSchema is the JSON Schema used for validation.
    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'],
        },
  • The tool is registered in the toolDefinitions map under the key 'kibela_update_note_content', mapping to updateNoteContentTool which is imported from './updateNoteContent'.
      kibela_update_note_content: updateNoteContentTool,
      kibela_create_note: createNoteTool,
    } as const
  • The GraphQL mutation helper that sends the 'UpdateNoteContent' mutation to the Kibela API. Accepts variables: clientMutationId, id, newContent, and baseContent (for optimistic locking/version control).
    import { TypedDocumentNode } from '@graphql-typed-document-node/core'
    import { gql } from 'graphql-tag'
    import { gqlRequest } from '../request'
    
    type UpdateNoteContentResponse = {
      updateNoteContent: {
        clientMutationId: string
        note: {
          id: string
        }
      }
    }
    
    type UpdateNoteContentVariables = {
      input: {
        clientMutationId: string
        id: string
        newContent: string
        baseContent: string
      }
    }
    
    const updateNoteContentMutation: TypedDocumentNode<UpdateNoteContentResponse, UpdateNoteContentVariables> = gql`
      mutation UpdateNoteContent($input: UpdateNoteContentInput!) {
        updateNoteContent(input: $input) {
          clientMutationId
          note {
            id
          }
        }
      }
    `
    
    export async function updateNoteContent(variables: UpdateNoteContentVariables): Promise<UpdateNoteContentResponse> {
      return gqlRequest(updateNoteContentMutation, variables)
    }
  • The GraphQL query helper that fetches a note by ID (including content field), used by the handler to get the current baseContent before updating.
    import { TypedDocumentNode } from '@graphql-typed-document-node/core'
    import { gql } from 'graphql-tag'
    import { gqlRequest } from '../request'
    
    type GetNoteResponse = {
      note: {
        id: string
        title: string
        content: string
      }
    }
    
    type GetNoteVariables = {
      id: string
    }
    
    const getNoteQuery: TypedDocumentNode<GetNoteResponse, GetNoteVariables> = gql`
      query GetNote($id: ID!) {
        note(id: $id) {
          id
          title
          content
        }
      }
    `
    
    export async function getNote(variables: GetNoteVariables): Promise<GetNoteResponse> {
      return gqlRequest(getNoteQuery, variables)
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so description carries full burden. It reveals that tool fetches current content before updating for version control, which is a key behavioral trait. However, it could mention error handling or idempotency. On balance, adds value beyond schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is three concise sentences, no redundancy. Front-loaded with purpose. Could be slightly more structured but is efficient and readable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, description covers key aspects: update action, pre-fetch, and parameter requirements. However, it lacks information about return value or error scenarios, leaving some gaps for an agent to understand full behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, baseline 3. Description adds significant context: for 'id', explains difference from path and workflow; for 'content', specifies markdown format and replacement semantics. This enhances understanding beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it updates note content by note id. It distinguishes from sibling tools like kibela_create_note, kibela_get_note_content, and kibela_search_notes by specifying the update action and the requirement of note ID.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly tells when to use this tool (when you have note ID) and provides guidance for note path users: use kibela_get_note_from_path first. Also mentions the pre-fetch step for version control, indicating expected usage pattern.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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