Skip to content

fix(dsql): pin awslabs/mcp doc links to a commit permalink - #300

Open
avneetbansal-aws wants to merge 1 commit into
awslabs:mainfrom
avneetbansal-aws:fix/dsql-permalinks-217
Open

avneetbansal-aws wants to merge 1 commit into
awslabs:mainfrom
avneetbansal-aws:fix/dsql-permalinks-217

Conversation

@avneetbansal-aws

@avneetbansal-aws avneetbansal-aws commented Nov 6, 2026 •

Copy link
Copy Markdown


This change replaces the three mutable awslabs/mcp blob/main links in the DSQL MCP tool docs with a permalink pinned to awslabs/mcp commit dbf8c317815911259b43e13cc79c9e83e0105fc1. The links are in mcp/tools/database-tools.md (line 125) and mcp/tools/input-validation.md (lines 56 and 61). The #L anchors are unchanged: L295-L318 for the write-mode note, and L141 for the readonly_query signature. Fixes #217.

The issue suggests pinning to a commit, and a plain swap to the current main sha would have passed the hook. The links would then have pointed at the wrong code, though. The anchors were written against an older server.py, and on current main those line ranges now land on a docstring and unrelated signatures, because readonly_query and transact have since moved and gained params_list. The pinned commit is the last revision before that rewrite. At dbf8c31, lines 141-142 are the readonly_query(sql, ctx) signature, lines 267-272 are the transact(sql_list, ctx) signature with no parameter binding, and lines 295-318 are the read_only validation block that write mode skips. That matches what both docs say about SQL-only inputs and about write mode disabling the server-side filters.

The tradeoff is that the docs now describe a historical version of the server rather than its current behaviour. If you prefer a link that tracks main, the alternative from the issue is to exclude these two files from check-vcs-permalinks. That would be a small follow-up if you want it. The prose in the docs was not changed, so reviewers may also want to check whether the newer params_list support should be documented separately.

Running python -m pre_commit run check-vcs-permalinks --all-files in the branch passes. The server.py contents at the pinned sha were read through the GitHub API to confirm the three line ranges. The hook did not flag the aws-samples links in references/language.md, so that file is untouched.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.

Replace the three mutable awslabs/mcp blob/main links in the DSQL MCP
tool docs with permalinks to awslabs/mcp@dbf8c31.
That is the last server.py revision before the params_list/injection-filter
rewrite, and the one the existing L141, L267-272 and L295-318 anchors and the
surrounding text describe: readonly_query(sql, ctx) and transact(sql_list, ctx)
with no parameter binding, and the read_only validation block at L295-318.
Pinning to current main would have kept the anchors but pointed them at
different code, since those ranges have drifted.

Fixes awslabs#217

Verified in the worktree:
- python -m pre_commit run check-vcs-permalinks --all-files: Passed
- Fetched server.py at the pinned sha via the GitHub contents API and read
  lines 141-142, 267-272 and 295-318 to confirm they match the doc text.
- The hook did not flag references/language.md, so its aws-samples links are
  unchanged.

Signed-off-by: avneetbansal-aws <284363899+avneetbansal-aws@users.noreply.github.com>
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.

pre-commit: check-vcs-permalinks fails on non-permalink GitHub URLs in docs

1 participant