microsoft / microsoft/documentdb-mcp

[DX] Improve deny / config error messages with actionable fix-hints

Open
#54 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

dx release-readiness tier-1
Dominant language
TypeScript
Stars
2
Forks
4
Avg merge
6d 21h
Merged PRs (30d)
3

Description

Goal

Every error the user can fix should tell them how to fix it.

What to ship

Audit error strings in:

  • src/security/connectionProfiles.ts (assertProfileCapabilityAllowed, assertResourceAllowed)
  • src/security/authorization.ts (assertAuthorized, assertCapabilityEnabled)
  • src/tools/utils/dbGuard.ts
  • src/tools/utils/pipelineNamespaces.ts

Convert each to <what happened>. <how to fix>. Examples:

Before After
Tool tier 'write' is not allowed for connection profile 'dev'. Allowed tiers: read. (same) To enable, add "allowedRoles": ["read","write"] to the profile.
Database 'fleet' is denied for connection profile 'dev'. Database 'fleet' is explicitly denied for connection profile 'dev'. Remove it from "deniedDatabases" to allow.
Aggregation stage \ references secrets.creds: Database 'secrets' is not allowed. (same) Add 'secrets' to "allowedDatabases" on the profile, or restructure the pipeline.

Acceptance criteria

  • Every user-fixable deny error includes a one-clause fix hint.
  • Error format stays consistent across the codebase (one place, one shape).
  • Existing tests updated to match new strings.

Why

MCP errors land in the LLM's context and get parroted back to the operator. A fix-hint shortens the support cycle for free and reduces "why doesn't this work?" GitHub issues.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by auditing the error strings in src/security/connectionProfiles.ts, src/security/authorization.ts, src/tools/utils/dbGuard.ts, and src/tools/utils/pipelineNamespaces.ts, including the named assertion functions. Update each user-fixable denial to use a consistent two-part format with an actionable hint, then update the existing tests and verify every fixable error is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend-api-design, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.