You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: improve MCP tool descriptions to address Glama score issues
Address the following scoring dimensions flagged by Glama.ai:
- Behavior: All tools now explicitly state 'Read-only' nature
- Parameters: Every tool documents config, repo_path, config_path params
- Completeness: Return value format (status + per-check results) described
- Usage Guidelines: Each tool explains when to use vs sibling tools
- Purpose: Retained clear verb+resource structure
Tools updated: server_health, validate_commit_message, validate_branch_name,
validate_author_info, validate_push_safety, validate_commit_context,
validate_repository_state, describe_validation_rules
Copy file name to clipboardExpand all lines: src/commit_check_mcp/server.py
+77-8Lines changed: 77 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -320,7 +320,7 @@ def _validate_all(
320
320
321
321
@mcp.tool()
322
322
defserver_health() ->dict[str, str]:
323
-
"""Return server and dependency versions."""
323
+
"""Return server and dependency versions. Read-only, no side effects. Returns dict with server name, server version, commit-check version, and MCP SDK version. Useful as a first call to verify the server is running and check version compatibility."""
324
324
return {
325
325
"server": "commit-check-mcp",
326
326
"server_version": __version__,
@@ -336,7 +336,16 @@ def validate_commit_message(
336
336
repo_path: str|None=None,
337
337
config_path: str|None=None,
338
338
) ->dict[str, Any]:
339
-
"""Validate a commit message against commit-check rules."""
339
+
"""Validate a commit message against commit-check rules. Read-only validation. Returns a structured result with overall status ('pass'/'fail') and a list of per-check results. Each check includes the check name, status, value, error message (on failure), and suggestion (on failure).
340
+
341
+
Use this tool when you have a specific commit message string to validate. For batch validation of message, branch, and author together, use validate_commit_context instead.
342
+
343
+
Parameters:
344
+
- message (required): The commit message text to validate.
345
+
- config (optional): Inline JSON config overrides on top of any loaded config file.
346
+
- repo_path (optional): Path to the git repository for repo-relative config loading.
347
+
- config_path (optional): Path to a custom commit-check TOML config file.
"""Validate branch naming conventions with commit-check."""
367
+
"""Validate branch naming conventions with commit-check. Read-only validation. Returns a structured result with overall status ('pass'/'fail') and per-check results (check name, status, value, error, suggest).
368
+
369
+
Use this when you need to verify a branch name follows configured convention rules (e.g., feature/*, bugfix/*). For combined message+branch+author validation, use validate_commit_context.
370
+
371
+
Parameters:
372
+
- branch (optional): The branch name to validate. If omitted, detected from the current repo.
raiseValueError("branch cannot be empty when provided")
@@ -376,7 +394,17 @@ def validate_author_info(
376
394
repo_path: str|None=None,
377
395
config_path: str|None=None,
378
396
) ->dict[str, Any]:
379
-
"""Validate commit author name and/or email with commit-check."""
397
+
"""Validate commit author name and/or email with commit-check. Read-only validation. Returns a structured result with overall status and per-check results (check name, status, value, error, suggest).
398
+
399
+
Use this when you need to verify author metadata against configured rules (e.g., allowed email domains, name patterns). When both name and email are provided, both are validated. If neither is provided, both are checked against repo context. For combined validation, use validate_commit_context.
400
+
401
+
Parameters:
402
+
- author_name (optional): The author name to validate.
403
+
- author_email (optional): The author email to validate.
"""Validate that a push is not a force push. Read-only validation. Returns a structured result with overall status and per-check results (check name, status, value, error, suggest). By default, force push is rejected; configure via 'push.allow_force_push' in config.
434
+
435
+
Use this before performing a git push to ensure force-push protection rules are satisfied. Only validates the no_force_push rule. Use validate_commit_context for combined checks.
436
+
437
+
Parameters:
438
+
- push_refs (optional): The push ref specification to validate. If omitted, checks upstream fallback state.
"""Run combined commit-check validations in one call."""
463
+
"""Run combined commit-check validations for message, branch, and/or author in one call. Read-only validation. Returns a structured result with overall status and a unified list of per-check results (check name, status, value, error, suggest).
464
+
465
+
Use this when you need to validate multiple commit aspects simultaneously in a single call. At least one of message, branch, author_name, or author_email must be provided. For individual aspects, use the specific validate_commit_message, validate_branch_name, or validate_author_info tools.
466
+
467
+
Parameters:
468
+
- message (optional): Commit message text to validate.
469
+
- branch (optional): Branch name to validate.
470
+
- author_name (optional): Author name to validate.
471
+
- author_email (optional): Author email to validate.
472
+
- config (optional): Inline JSON config overrides on top of any loaded config file.
473
+
- repo_path (optional): Path to the git repository for repo-relative config loading.
474
+
- config_path (optional): Path to a custom commit-check TOML config file.
"""Validate the latest commit, branch, author, and optional push safety state."""
517
+
"""Validate the current repository state including latest commit message, active branch, author metadata, and optional push safety. Read-only validation. Reads git data (message, branch, author) from the local repository. Returns a structured result with overall status and per-check results.
518
+
519
+
Use this to validate the entire state of a local git repository in one call — ideal for pre-commit or CI hooks. Controls which checks run via boolean include_* flags. For validating arbitrary (non-repo) values, use validate_commit_context or individual validation tools instead.
520
+
521
+
Parameters:
522
+
- repo_path (optional): Path to the git repository. If omitted, uses current working directory.
523
+
- config (optional): Inline JSON config overrides on top of any loaded config file.
524
+
- config_path (optional): Path to a custom commit-check TOML config file.
525
+
- include_message (optional, default true): Whether to validate the latest commit message.
526
+
- include_branch (optional, default true): Whether to validate the current branch name.
527
+
- include_author (optional, default true): Whether to validate the latest commit author.
528
+
- include_push (optional, default false): Whether to validate push safety.
"""Return enabled commit-check rules after merging defaults, repo config, and overrides."""
588
+
"""Return enabled commit-check rules after merging defaults, repo config, and inline overrides. Read-only, no side effects. Returns a dict with commit_check_version, the full merged config, supported check types, and enabled rules (each with check name, config, and pattern details).
589
+
590
+
Use this to inspect which validation rules are currently active before running any validation. Helps debug rule configuration and check which checks will be applied.
591
+
592
+
Parameters:
593
+
- config (optional): Inline JSON config overrides on top of any loaded config file.
594
+
- repo_path (optional): Path to the git repository for repo-relative config loading.
595
+
- config_path (optional): Path to a custom commit-check TOML config file.
0 commit comments