{"record":{"id":"f07a4f2194e05878","repo":"github/github-mcp-server","slug":"path-must-not-contain-control-characters","errorCode":null,"errorMessage":"path must not contain control characters","messagePattern":"path must not contain control characters","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/github/repositories.go","lineNumber":2460,"sourceCode":"\t\t}\n\t} `graphql:\"blame(path: $path)\"`\n}\n\n// validateBlamePath rejects empty, leading-slash, traversal-laden, or\n// control-character paths before any network call is made.\nfunc validateBlamePath(p string) error {\n\tif strings.TrimSpace(p) == \"\" {\n\t\treturn fmt.Errorf(\"path must not be empty\")\n\t}\n\tif strings.HasPrefix(p, \"/\") {\n\t\treturn fmt.Errorf(\"path must be relative to the repository root (no leading '/')\")\n\t}\n\tif slices.Contains(strings.Split(p, \"/\"), \"..\") {\n\t\treturn fmt.Errorf(\"path must not contain '..' segments\")\n\t}\n\tfor _, r := range p {\n\t\tif r < 0x20 || r == 0x7f {\n\t\t\treturn fmt.Errorf(\"path must not contain control characters\")\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc GetFileBlame(t translations.TranslationHelperFunc) inventory.ServerTool {\n\tst := NewTool(\n\t\tToolsetMetadataRepos,\n\t\tmcp.Tool{\n\t\t\tName: \"get_file_blame\",\n\t\t\tDescription: t(\"TOOL_GET_FILE_BLAME_DESCRIPTION\",\n\t\t\t\t\"Get git blame information for a file, showing the commit that last modified each line. \"+\n\t\t\t\t\t\"Ranges share commit metadata via the top-level 'commits' map keyed by SHA. \"+\n\t\t\t\t\t\"Use 'start_line'/'end_line' to restrict the result to a window of the file, and \"+\n\t\t\t\t\t\"'perPage'/'after' to cursor-page through returned ranges. Matching ranges are capped at \"+\n\t\t\t\t\t\"1000; when the cap is hit 'truncated' is set to true and 'total_ranges' reports the pre-cap match count.\",\n\t\t\t),\n\t\t\tAnnotations: &mcp.ToolAnnotations{","sourceCodeStart":2442,"sourceCodeEnd":2478,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/github/repositories.go#L2442-L2478","documentation":"Error \"path must not contain control characters\" thrown in github/github-mcp-server.","triggerScenarios":"Thrown at pkg/github/repositories.go:2460 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}