MCPcopy Create free account
hub / github.com/agenticsorg/edge-agents / get_repository

Function get_repository

scripts/agents/devops/src/github/github_tools.py:47–87  ·  view source on GitHub ↗

Get details for a GitHub repository. Args: ctx: Run context containing DevOpsContext request: Parameters for the repository request Returns: GitHubRepository object with repository details

(
    ctx: RunContext[DevOpsContext],
    request: GitHubRepoRequest
)

Source from the content-addressed store, hash-verified

45
46@function_tool()
47async def get_repository(
48 ctx: RunContext[DevOpsContext],
49 request: GitHubRepoRequest
50) -> GitHubRepository:
51 """
52 Get details for a GitHub repository.
53
54 Args:
55 ctx: Run context containing DevOpsContext
56 request: Parameters for the repository request
57
58 Returns:
59 GitHubRepository object with repository details
60 """
61 logger.info(f"Getting repository details for {request.owner}/{request.repo}")
62
63 # Get GitHub client
64 g = _get_github_client()
65
66 # Get repository
67 repo = g.get_repo(f"{request.owner}/{request.repo}")
68
69 # Convert to GitHubRepository model
70 result = GitHubRepository(
71 name=repo.name,
72 full_name=repo.full_name,
73 description=repo.description,
74 url=repo.html_url,
75 default_branch=repo.default_branch,
76 stars=repo.stargazers_count,
77 forks=repo.forks_count,
78 open_issues=repo.open_issues_count,
79 language=repo.language,
80 private=repo.private,
81 created_at=repo.created_at.isoformat() if repo.created_at else None,
82 updated_at=repo.updated_at.isoformat() if repo.updated_at else None,
83 topics=repo.get_topics() if hasattr(repo, 'get_topics') else None
84 )
85
86 logger.info(f"Retrieved repository details for {request.owner}/{request.repo}")
87 return result
88
89
90@function_tool()

Callers

nothing calls this directly

Calls 2

_get_github_clientFunction · 0.85
GitHubRepositoryClass · 0.70

Tested by

no test coverage detected