{"ok":true,"site":{"host":"haoku.app","url":"https://haoku.app/","type":"live","desc":"Haoku","tools":[{"name":"list_sources","kind":"answer","impl":"imperative","description":"Lists the sources in the workspace: id, name, kind (pdf, text, image), the url pasted text came from, pages, size, and how many blocks cite each one.","title":"List the sources","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{}},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"search_sources","kind":"answer","impl":"imperative","description":"Finds a phrase across the PDF and text sources (or some of them) and returns hits ready to cite: source, page, occurrence, the exact passage and its surroundings.","title":"Search the sources","annotations":{"readOnlyHint":true,"untrustedContentHint":true},"inputSchema":{"type":"object","properties":{"query":{"type":"string","description":"Words to look for; case, spacing and hyphenation are ignored."},"sources":{"type":"array","items":{"type":"string","description":"A source by id (from list_sources) or by file name."},"description":"Restrict the search to these sources."},"limit":{"type":"integer","minimum":1,"maximum":100,"description":"Defaults to 30."}},"required":["query"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"read_source","kind":"answer","impl":"imperative","description":"Returns the text of one page of a PDF, the whole text of a text source, or an image as a data URL. Quote from it to cite.","title":"Read a source","annotations":{"readOnlyHint":true,"untrustedContentHint":true},"inputSchema":{"type":"object","properties":{"source":{"type":"string","description":"A source by id (from list_sources) or by file name."},"page":{"type":"integer","minimum":1,"description":"PDF page to read. Defaults to 1."}},"required":["source"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"get_selection","kind":"answer","impl":"imperative","description":"Where the user is right now: the selected block (id, type, content, markdown, citations), any text selected in the document, any text selected in an open source, which source is open, and how many passages wait in the context. Read the passages themselves with list_context.","title":"What the user is pointing at","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{}},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"list_context","kind":"answer","impl":"imperative","description":"The passages the user gathered from the sources, in two groups. \"free\" are not cited by any block yet: they are the material a new block is built from, and add_block and link_sources use them by default. \"used\" are already cited somewhere in the document; they are listed so you can tell them apart, and citing one again is refused. For what the document already says use get_workspace; to read a source itself use read_source.","title":"Read the gathered passages","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{}},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"get_workspace","kind":"answer","impl":"imperative","description":"Returns the title, the sources, every block in order (id, type, excerpt or full content + markdown, citations with their footnote keys), the footnotes, which sections are covered, and — with include_markdown — the whole document as markdown.","title":"Read the knowledge space","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"include_content":{"type":"boolean","description":"Return full block content and markdown instead of excerpts. Defaults to false."},"include_markdown":{"type":"boolean","description":"Also return the whole document as one markdown string (blocks, elements, footnotes)."}}},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"set_title","kind":"act","impl":"imperative","description":"Renames the space: the name in the top bar, the title of the printed document and the file name of an export. Short and about the subject, the way a chapter is named — the user can undo it.","title":"Name the space","annotations":{},"inputSchema":{"type":"object","properties":{"title":{"type":"string","description":"The new name, e.g. \"Memory in AI agents\"."}},"required":["title"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"add_block","kind":"act","impl":"imperative","description":"Adds a block and shows it at once. Either give \"type\" and \"content\" — heading: { text, level?: 1|2|3 (default 2) }; paragraph: { text } — markdown; write [1], [2]… in the text to mark where each citation applies (they become footnotes); callout: { title?, body (markdown), tone?: \"idea\"|\"example\"|\"warning\"|\"why\" (default \"idea\") }; diagram: { title?, nodes: [{ label, citation? }], edges?: [{ from, to, label? }] } — any graph: from/to by 1-based node position or label, branches and cycles allowed, laid out automatically; without edges the nodes form a chain; comparison: { title?, columns: [string], rows: [{ label, cells: [string] }] }; image: { source: an image source (id or name), caption? } — or give raw \"markdown\" for one block. The passages the user gathered in the context and has not used yet are cited by default (use_collected: false to leave them). Block markdown: `## heading`, free markdown paragraphs, a GFM table (first column = row labels, optional **title** line above), `![caption](space://<source_id>)`, or an element: <space-callout tone=\"…\" title=\"…\">body</space-callout>, <space-diagram title=\"…\">{\"nodes\":[{\"label\"}],\"edges\":[{\"from\":0,\"to\":1}]}</space-diagram>, Cite with [^k] marks (keys from get_workspace) or list citations and use [1], [2]….","title":"Add a block to the document","annotations":{},"inputSchema":{"type":"object","properties":{"type":{"type":"string","enum":["heading","paragraph","callout","diagram","comparison","image"]},"content":{"type":"object","description":"Shape depends on type; see the tool description."},"markdown":{"type":"string","description":"Raw markdown for exactly one block, instead of type + content."},"position":{"description":"Where the block goes: \"end\" (default), \"start\", { \"after\": block_id }, { \"before\": block_id } or { \"in_section\": heading_block_id } for the end of that section.","oneOf":[{"type":"string","enum":["end","start"]},{"type":"object","properties":{"after":{"type":"string"}},"required":["after"]},{"type":"object","properties":{"before":{"type":"string"}},"required":["before"]},{"type":"object","properties":{"in_section":{"type":"string"}},"required":["in_section"]}]},"citations":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","description":"A source by id (from list_sources) or by file name."},"page":{"type":"integer","minimum":1,"description":"Page number as printed, starting at 1. Text sources are a single page."},"quote":{"type":"string","description":"A passage of the source, quoted from read_source or search_sources. Spacing, line breaks and hyphenation do not matter."},"occurrence":{"type":"integer","minimum":1,"description":"Which occurrence when the quote repeats on the page. Defaults to 1."}},"required":["source"],"description":"Where a piece of content comes from. Give page and quote for PDFs and text; an image is cited by source alone."},"description":"Passages this block draws on, in the order the [n] marks refer to. A passage another block already cites is refused: each one backs a single block."},"use_collected":{"type":"boolean","description":"Defaults to true: the block cites the passages the user gathered in the context and has not used yet (get_selection → gathered, the ones with free: true), before any listed here, and the basket is emptied. Pass false when the block has nothing to do with them."}}},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"update_block","kind":"act","impl":"imperative","description":"Changes a block: partial \"content\" (same shape as add_block for its type; fields left out stay, collections replace), or raw \"markdown\" for the whole block, and/or \"citations\" that replace the ones it has.","title":"Change a block","annotations":{},"inputSchema":{"type":"object","properties":{"block_id":{"type":"string"},"content":{"type":"object","description":"Same shape as add_block for the block's type; partial."},"markdown":{"type":"string","description":"Raw markdown replacing the whole block (one block)."},"citations":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","description":"A source by id (from list_sources) or by file name."},"page":{"type":"integer","minimum":1,"description":"Page number as printed, starting at 1. Text sources are a single page."},"quote":{"type":"string","description":"A passage of the source, quoted from read_source or search_sources. Spacing, line breaks and hyphenation do not matter."},"occurrence":{"type":"integer","minimum":1,"description":"Which occurrence when the quote repeats on the page. Defaults to 1."}},"required":["source"],"description":"Where a piece of content comes from. Give page and quote for PDFs and text; an image is cited by source alone."},"description":"Replaces the block's citations."}},"required":["block_id"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"remove_block","kind":"act","impl":"imperative","description":"Deletes one or more blocks from the document. undo brings them back.","title":"Delete blocks","annotations":{},"inputSchema":{"type":"object","properties":{"block_ids":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["block_ids"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"move_block","kind":"act","impl":"imperative","description":"Moves a block to another position in the document.","title":"Move a block","annotations":{},"inputSchema":{"type":"object","properties":{"block_id":{"type":"string"},"position":{"description":"Where the block goes: \"end\" (default), \"start\", { \"after\": block_id }, { \"before\": block_id } or { \"in_section\": heading_block_id } for the end of that section.","oneOf":[{"type":"string","enum":["end","start"]},{"type":"object","properties":{"after":{"type":"string"}},"required":["after"]},{"type":"object","properties":{"before":{"type":"string"}},"required":["before"]},{"type":"object","properties":{"in_section":{"type":"string"}},"required":["in_section"]}]}},"required":["block_id","position"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"focus_block","kind":"act","impl":"imperative","description":"Selects a block, scrolls the document to it and flashes it, so the user sees what you are talking about.","title":"Bring the user to a block","annotations":{},"inputSchema":{"type":"object","properties":{"block_id":{"type":"string"}},"required":["block_id"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"open_source","kind":"act","impl":"imperative","description":"Opens a source in the viewer beside the document, at a page or at a quoted passage, which is marked.","title":"Open a source for the user","annotations":{},"inputSchema":{"type":"object","properties":{"source":{"type":"string","description":"A source by id (from list_sources) or by file name."},"page":{"type":"integer","minimum":1,"description":"Page number as printed, starting at 1. Text sources are a single page."},"quote":{"type":"string","description":"A passage of the source, quoted from read_source or search_sources. Spacing, line breaks and hyphenation do not matter."},"occurrence":{"type":"integer","minimum":1}},"required":["source"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"highlight_source","kind":"act","impl":"imperative","description":"Leaves a persistent coloured wash on a quoted passage of a PDF source, with an optional note. Visible whenever that source is open.","title":"Highlight a passage in a PDF","annotations":{},"inputSchema":{"type":"object","properties":{"source":{"type":"string","description":"A source by id (from list_sources) or by file name."},"page":{"type":"integer","minimum":1,"description":"Page number as printed, starting at 1. Text sources are a single page."},"quote":{"type":"string","description":"A passage of the source, quoted from read_source or search_sources. Spacing, line breaks and hyphenation do not matter."},"occurrence":{"type":"integer","minimum":1},"kind":{"type":"string","enum":["claim","definition","evidence","concept"],"description":"What the passage is. Defaults to \"claim\"."},"note":{"type":"string"}},"required":["source","quote"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"link_sources","kind":"act","impl":"imperative","description":"Attaches passages from the sources to an existing block, keeping what it already cites: the ones the user gathered and has not used yet (unless use_collected: false) and/or the ones listed. Text blocks get a [^k] mark per passage at the end; elements get them in their cites attribute. Place marks yourself with update_block if you want them elsewhere.","title":"Link passages to a block","annotations":{},"inputSchema":{"type":"object","properties":{"block_id":{"type":"string","description":"Defaults to the selected block."},"passages":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","description":"A source by id (from list_sources) or by file name."},"page":{"type":"integer","minimum":1,"description":"Page number as printed, starting at 1. Text sources are a single page."},"quote":{"type":"string","description":"A passage of the source, quoted from read_source or search_sources. Spacing, line breaks and hyphenation do not matter."},"occurrence":{"type":"integer","minimum":1,"description":"Which occurrence when the quote repeats on the page. Defaults to 1."}},"required":["source"],"description":"Where a piece of content comes from. Give page and quote for PDFs and text; an image is cited by source alone."}},"use_collected":{"type":"boolean","description":"Defaults to true: links the passages the user gathered in the context and has not used yet (get_selection → gathered, the ones with free: true), and empties the basket. Pass false to link only the passages listed here."}}},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"add_practice","kind":"act","impl":"imperative","description":"Adds multiple-choice questions to the practice bank (the \"practice\" tab), outside the document. Tie each one to the passage it checks with a citation. The document itself holds no questions: this bank is the only place they live.","title":"Add practice questions","annotations":{},"inputSchema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","description":"A multiple-choice question { prompt, options: [string], answer: 1-based position or the option text, explanation?, citation?, topic? }.","properties":{"prompt":{"type":"string"},"options":{"type":"array","items":{"type":"string"},"minItems":2},"answer":{"description":"1-based position of the right option, or its text."},"explanation":{"type":"string","description":"Shown after answering."},"citation":{"type":"object","properties":{"source":{"type":"string","description":"A source by id (from list_sources) or by file name."},"page":{"type":"integer","minimum":1,"description":"Page number as printed, starting at 1. Text sources are a single page."},"quote":{"type":"string","description":"A passage of the source, quoted from read_source or search_sources. Spacing, line breaks and hyphenation do not matter."},"occurrence":{"type":"integer","minimum":1,"description":"Which occurrence when the quote repeats on the page. Defaults to 1."}},"required":["source"],"description":"The passage the question checks; shown as \"source →\" while practising."},"topic":{"type":"string","description":"A short label to group questions (usually a section title)."}},"required":["prompt","options","answer"]},"minItems":1}},"required":["items"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"list_practice","kind":"answer","impl":"imperative","description":"Returns the practice questions with how the user has done on each: seen, right, wrong.","title":"Read the practice questions and progress","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{}},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"remove_practice","kind":"act","impl":"imperative","description":"Removes questions from the practice bank by id (ids from list_practice).","title":"Remove practice questions","annotations":{},"inputSchema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["ids"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"undo","kind":"act","impl":"imperative","description":"Takes back the most recent change to the document or highlights — or several with steps — and reports what came back.","title":"Undo the last change","annotations":{},"inputSchema":{"type":"object","properties":{"steps":{"type":"integer","minimum":1,"description":"How many changes. Defaults to 1."}}},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"redo","kind":"act","impl":"imperative","description":"Re-applies changes taken back with undo, one or several with steps.","title":"Redo an undone change","annotations":{},"inputSchema":{"type":"object","properties":{"steps":{"type":"integer","minimum":1,"description":"How many changes. Defaults to 1."}}},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"}],"category":"Health & Education","favicon":"/favicons/haoku.app.png","apiSurface":"spec","toolCount":20}}