github_code_search
Search GitHub repositories for specific code snippets using exact matches. Find files containing particular code patterns across projects to analyze implementations or locate examples.
Instructions
Search files on GitHub with code snippets.
Normally you should try different queries and combinations of filters until you get useful results. If you are searching for something generic, try thinking in reverse about what the code might be, and search for that code snippet instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code_snippet | Yes | Not a fuzzy search. Grep exact code snippet you want to find. Modifiers or wildcards not supported. | |
| extension | No | ||
| filename | No | ||
| owner | No | ||
| repo | No | Format: owner/repo | |
| language | No | ||
| match_type | No | content |
Input Schema (JSON Schema)
{
"properties": {
"code_snippet": {
"description": "Not a fuzzy search. Grep exact code snippet you want to find. Modifiers or wildcards not supported.",
"type": "string"
},
"extension": {
"type": "string"
},
"filename": {
"type": "string"
},
"language": {
"type": "string"
},
"match_type": {
"default": "content",
"enum": [
"content",
"path"
],
"type": "string"
},
"owner": {
"items": {
"type": "string"
},
"type": "array"
},
"repo": {
"description": "Format: owner/repo",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"code_snippet"
],
"type": "object"
}