SearchOrgs creates a tool to search for GitHub organizations.
(t translations.TranslationHelperFunc)
| 452 | |
| 453 | // SearchOrgs creates a tool to search for GitHub organizations. |
| 454 | func SearchOrgs(t translations.TranslationHelperFunc) inventory.ServerTool { |
| 455 | schema := &jsonschema.Schema{ |
| 456 | Type: "object", |
| 457 | Properties: map[string]*jsonschema.Schema{ |
| 458 | "query": { |
| 459 | Type: "string", |
| 460 | Description: "Organization search query. Examples: 'microsoft', 'location:california', 'created:>=2025-01-01'. Search is automatically scoped to type:org.", |
| 461 | }, |
| 462 | "sort": { |
| 463 | Type: "string", |
| 464 | Description: "Sort field by category", |
| 465 | Enum: []any{"followers", "repositories", "joined"}, |
| 466 | }, |
| 467 | "order": { |
| 468 | Type: "string", |
| 469 | Description: "Sort order", |
| 470 | Enum: []any{"asc", "desc"}, |
| 471 | }, |
| 472 | }, |
| 473 | Required: []string{"query"}, |
| 474 | } |
| 475 | WithPagination(schema) |
| 476 | |
| 477 | return NewTool( |
| 478 | ToolsetMetadataOrgs, |
| 479 | mcp.Tool{ |
| 480 | Name: "search_orgs", |
| 481 | Description: t("TOOL_SEARCH_ORGS_DESCRIPTION", "Find GitHub organizations by name, location, or other organization metadata. Ideal for discovering companies, open source foundations, or teams."), |
| 482 | Annotations: &mcp.ToolAnnotations{ |
| 483 | Title: t("TOOL_SEARCH_ORGS_USER_TITLE", "Search organizations"), |
| 484 | ReadOnlyHint: true, |
| 485 | }, |
| 486 | InputSchema: schema, |
| 487 | }, |
| 488 | []scopes.Scope{scopes.ReadOrg}, |
| 489 | func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) { |
| 490 | return userOrOrgHandler(ctx, "org", deps, args) |
| 491 | }, |
| 492 | ) |
| 493 | } |
| 494 | |
| 495 | // SearchCommits creates a tool to search for commits across GitHub repositories. |
| 496 | func SearchCommits(t translations.TranslationHelperFunc) inventory.ServerTool { |