Skip to content

Return working app links from list_documents and search_documents - #13

Merged
jaowcz merged 2 commits into
mainfrom
jaowcz/broken-document-link-fix
Oct 16, 2026
Merged

jaowcz merged 2 commits into
mainfrom
jaowcz/broken-document-link-fix

Conversation

@jaowcz

@jaowcz jaowcz commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

list_documents and search_documents returned no link, so models guessed app.contractbook.com/documents/{id}, which just redirects to the contract list. Each document now has a url built the same way as the web app's getDocumentPath: /draft, /stored-contract or /contract, followed by the encoded title (% becomes -, # is removed) and the id. The tool descriptions now tell the model to use that url and never build links itself. create_document_from_template uses the same documentUrl() helper from shared.ts. New tests cover each route, special characters in titles and a missing title.

🤖 Generated with Claude Code

Neither tool returned a link, so models guessed app.contractbook.com/documents/{id},
which redirects to the contract list. Build links the way the web app does
(/draft, /stored-contract or /contract, plus the encoded title and id) and share
the helper with create_document_from_template.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jaowcz
jaowcz merged commit 4776da5 into main Oct 16, 2026
1 check passed
@jaowcz
jaowcz deleted the jaowcz/broken-document-link-fix branch October 16, 2026 08: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