Let hackmd_get_note leave the body out

Closed
PA
2d ago
+56-4

Closes #25

Adds include_content (default true) to hackmd_get_note. With false, the body is dropped from the result after body_hash is computed; every other field stays. With local_path the flag is refused like team_path and refresh, since the sync report has no body. The tool description and docs/tools.md say it saves context, not requests.

Tests

  • without_content_the_body_hash_stays: no content, body_hash of the body as read, other fields kept.
  • exactly_one_of_note_ref_and_local_path_is_taken now also covers local_path with include_content: false.
  • cargo test --all-features: 353 passed; cargo clippy --all-features --all-targets: clean.
  • Manual check against hackmd.io on a team note: the result without the body has the same body_hash as a full read (about 1 KB instead of 23 KB).

šŸ¤– Generated with Claude Code


Summary by cubic

Adds include_content (default true) to hackmd_get_note so callers can check many notes for changes or read their permissions without pulling every body into context.

  • With false, the body is dropped from the result after body_hash is computed; every other field stays.
  • HackMD still sends the whole note, so this saves context, not requests.
  • With local_path, include_content: false is refused like team_path and refresh, since the sync report carries no body.