Skip to content

Add opt-in space to get_document_content - #11

Merged
jaowcz merged 2 commits into
mainfrom
jaowcz/return-document-space-location
Oct 16, 2026
Merged

jaowcz merged 2 commits into
mainfrom
jaowcz/return-document-space-location

Conversation

@jaowcz

@jaowcz jaowcz commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

get_document_content gets an include_space flag that returns the space the document is in as space: {id, name}, or null when the document isn't in any space the user can access. It reuses the GET v3/documents/:id request behind include_data_fields, so asking for both still costs one extra request. If that request fails, the text is still returned with space: null and a space_error; an unexpected response shape also gives space: null, without an error. The shared request's grace period is renamed to DOCUMENT_DETAILS_GRACE_MS, so its timeout message now says "document details request", and the tests cover the new flag on its own, combined with data fields, a null space and failure cases.

🤖 Generated with Claude Code

include_space returns the space the document is in as space: {id, name},
or null when it isn't in a space the user can access. It shares the
GET v3/documents/:id request with include_data_fields, so setting both
costs one extra request. If that request fails, space is null and
space_error says why; the text is still returned.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jaowcz
jaowcz requested a review from dkanas October 12, 2026 11:26
Comment thread src/contractbook/client.ts Outdated
Comment thread src/tools/get-document-content.ts
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jaowcz
jaowcz merged commit c65e38b into main Oct 16, 2026
1 check passed
@jaowcz
jaowcz deleted the jaowcz/return-document-space-location branch October 16, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants