kibela_search_notes
Search and retrieve Kibela notes using a specific query with the MCP Kibela server. Access stored information quickly to support note management and updates.
Instructions
Search Kibela notes by query
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query |
Implementation Reference
- src/tools/searchNotes.ts:23-44 (handler)The handler function that implements the core logic of the 'kibela_search_notes' tool. It validates the query input, fetches notes via the searchNotes GraphQL helper, processes the response to extract document nodes, and returns the notes as a JSON-formatted text content block.handler: async (args) => { if (!args.query) { throw new Error('Query is required') } const response = await searchNotes({ query: args.query }) const edges = response.search?.edges ?? [] const notes = edges .filter((edge): edge is NonNullable<(typeof edges)[number]> => edge != null) .filter((edge) => edge.node?.document != null) .map((edge) => edge.node?.document) return { content: [ { type: 'text', text: JSON.stringify(notes, null, 2), }, ], } },
- src/tools/searchNotes.ts:9-22 (schema)The tool metadata including name, description, and input schema for validating the 'query' parameter.tool: { name: 'kibela_search_notes', description: 'Search Kibela notes by query', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query', }, }, required: ['query'], }, },
- src/tools/index.ts:9-16 (registration)Registers 'kibela_search_notes' by mapping it to searchNotesTool in the central toolDefinitions object, enabling lookup and execution via handleToolRequest.const toolDefinitions = { kibela_search_notes: searchNotesTool, kibela_get_my_notes: getMyNotesTool, kibela_get_note_content: getNoteContentTool, kibela_get_note_from_path: getNoteFromPathTool, kibela_update_note_content: updateNoteContentTool, kibela_create_note: createNoteTool, } as const
- Supporting GraphQL utility function called by the tool handler to perform the actual note search query.export async function searchNotes(variables: SearchNotesVariables): Promise<SearchNotesResponse> { return gqlRequest(searchNotesQuery, variables) }
- GraphQL query document used by the searchNotes helper to fetch notes by query.const searchNotesQuery: TypedDocumentNode<SearchNotesResponse, SearchNotesVariables> = gql` query SearchNotes($query: String!) { search(query: $query, first: 15) { edges { node { document { ... on Note { id title url } } } } } } `