kibela_get_note_content
Retrieve the full content of a Kibela note by providing its note ID.
Instructions
Get note content by note ID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Note ID |
Implementation Reference
- src/tools/getNoteContent.ts:23-43 (handler)The handler function that executes the kibela_get_note_content tool logic. It takes an id argument, calls getNote to fetch the note, and returns the note content as JSON.
handler: async (args) => { if (!args.id) { throw new Error('Note ID is required') } const response = await getNote({ id: args.id }) if (!response.note) { throw new Error('Note not found') } return { content: [ { type: 'text', text: JSON.stringify(response.note, null, 2), }, ], } }, } - src/tools/getNoteContent.ts:4-21 (schema)Type definition for GetNoteContentArgs (id: string) and the inputSchema for the tool defining the required 'id' string parameter.
export type GetNoteContentArgs = { id: string } export const getNoteContentTool: ToolDefinition<GetNoteContentArgs> = { tool: { name: 'kibela_get_note_content', description: 'Get note content by note ID', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Note ID', }, }, required: ['id'], }, - src/tools/index.ts:12-16 (registration)Registration of kibela_get_note_content in the tool definitions map, mapping the tool name to the getNoteContentTool definition.
kibela_get_note_content: getNoteContentTool, kibela_get_note_from_path: getNoteFromPathTool, kibela_update_note_content: updateNoteContentTool, kibela_create_note: createNoteTool, } as const - src/tools/types.ts:1-17 (schema)Generic ToolDefinition type used to define the tool's schema and handler structure.
import { Tool } from '@modelcontextprotocol/sdk/types.js' export type ToolResponse = { content: { type: 'text' text: string }[] isError?: boolean _meta?: { [x: string]: unknown } } export type ToolHandler<T> = (args: T) => Promise<ToolResponse> export type ToolDefinition<T> = { tool: Tool handler: ToolHandler<T> } - src/graphql/queries/getNote.ts:17-29 (helper)GraphQL query getNote that fetches note by ID, called by the handler to retrieve note data.
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) }