Skip to main content
Glama

list_repo_pulls

List pull requests you created in a repository. Specify the repo in 'owner/repo' format and optionally set a limit between 1 and 100. Only returns PRs authored by you.

Instructions

list pull requests created by the authenticated user for a repository

note: only returns PRs that the authenticated user created (tangled stores PRs in the creator's repo, so we can only see our own PRs).

Args: repo: repository identifier in 'owner/repo' format limit: maximum number of pulls to return (1-100)

Returns: ListPullsResult with list of pull requests

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoYesrepository identifier in 'owner/repo' format (e.g., 'zzstoatzz/tangled-mcp')
limitNomaximum number of pulls to return

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pullsYes

Implementation Reference

  • Core implementation of list_repo_pulls — queries atproto records (sh.tangled.repo.pull) filtered by target repo. Returns dict with pulls list.
    def list_repo_pulls(repo_id: str, limit: int = 50) -> dict[str, Any]:
        """list pull requests created by the authenticated user for a repository
    
        note: this only returns PRs that the authenticated user created.
        tangled stores PRs in the creator's repo, so we can only see our own PRs.
    
        Args:
            repo_id: repository identifier in "did/repo" format
            limit: maximum number of pulls to return
    
        Returns:
            dict containing pulls list
        """
        client = _get_authenticated_client()
    
        if not client.me:
            raise RuntimeError("client not authenticated")
    
        # parse repo_id to get owner_did and repo_name
        if "/" not in repo_id:
            raise ValueError(f"invalid repo_id format: {repo_id}")
    
        owner_did, repo_name = repo_id.split("/", 1)
    
        # get the repo AT-URI by querying the repo collection
        records = client.com.atproto.repo.list_records(
            models.ComAtprotoRepoListRecords.Params(
                repo=owner_did,
                collection="sh.tangled.repo",
                limit=100,
            )
        )
    
        repo_at_uri = None
        for record in records.records:
            if (name := getattr(record.value, "name", None)) is not None and name == repo_name:
                repo_at_uri = record.uri
                break
    
        if not repo_at_uri:
            raise ValueError(f"repo not found: {repo_id}")
    
        # list pull records from the authenticated user's collection
        response = client.com.atproto.repo.list_records(
            models.ComAtprotoRepoListRecords.Params(
                repo=client.me.did,
                collection="sh.tangled.repo.pull",
                limit=limit,
            )
        )
    
        # filter pulls by target repo and convert to dict format
        pulls = []
        for record in response.records:
            value = record.value
            target = getattr(value, "target", None)
            if not target:
                continue
    
            target_repo = getattr(target, "repo", None)
            if target_repo != repo_at_uri:
                continue
    
            source = getattr(value, "source", {})
            pulls.append(
                {
                    "uri": record.uri,
                    "cid": record.cid,
                    "title": getattr(value, "title", ""),
                    "source": {
                        "sha": getattr(source, "sha", ""),
                        "branch": getattr(source, "branch", ""),
                        "repo": getattr(source, "repo", None),
                    },
                    "target": {
                        "repo": target_repo,
                        "branch": getattr(target, "branch", ""),
                    },
                    "createdAt": getattr(value, "createdAt", ""),
                }
            )
    
        return {"pulls": pulls}
  • MCP tool handler decorated with @tangled_mcp.tool. Resolves repo identifier, delegates to _tangled.list_repo_pulls, returns ListPullsResult.
    @tangled_mcp.tool
    def list_repo_pulls(
        repo: Annotated[
            str,
            Field(
                description="repository identifier in 'owner/repo' format (e.g., 'zzstoatzz/tangled-mcp')"
            ),
        ],
        limit: Annotated[
            int, Field(ge=1, le=100, description="maximum number of pulls to return")
        ] = 20,
    ) -> ListPullsResult:
        """list pull requests created by the authenticated user for a repository
    
        note: only returns PRs that the authenticated user created (tangled stores
        PRs in the creator's repo, so we can only see our own PRs).
    
        Args:
            repo: repository identifier in 'owner/repo' format
            limit: maximum number of pulls to return (1-100)
    
        Returns:
            ListPullsResult with list of pull requests
        """
        # resolve owner/repo to (knot, did/repo)
        _, repo_id = _tangled.resolve_repo_identifier(repo)
        # list_repo_pulls doesn't need knot (queries atproto records, not XRPC)
        response = _tangled.list_repo_pulls(repo_id, limit)
    
        return ListPullsResult.from_api_response(response["pulls"])
  • Schema types: PullSource, PullTarget, PullInfo, ListPullsResult with from_api_response classmethod.
    """pull request types"""
    
    from typing import Any
    
    from pydantic import BaseModel, Field
    
    
    class PullSource(BaseModel):
        """source branch info for a pull request"""
    
        sha: str
        branch: str
        repo: str | None = None  # AT-URI of source repo (for cross-repo PRs)
    
    
    class PullTarget(BaseModel):
        """target branch info for a pull request"""
    
        repo: str  # AT-URI of target repo
        branch: str
    
    
    class PullInfo(BaseModel):
        """pull request information"""
    
        uri: str
        cid: str
        title: str
        source: PullSource
        target: PullTarget
        created_at: str = Field(alias="createdAt")
    
    
    class ListPullsResult(BaseModel):
        """result of listing pull requests"""
    
        pulls: list[PullInfo]
    
        @classmethod
        def from_api_response(cls, pulls_data: list[dict[str, Any]]) -> "ListPullsResult":
            """construct from pre-filtered pull data
    
            Args:
                pulls_data: list of pull dicts already filtered by target repo
    
            Returns:
                ListPullsResult with parsed pulls
            """
            pulls = []
            for pull in pulls_data:
                source = pull.get("source", {})
                target = pull.get("target", {})
                pulls.append(
                    PullInfo(
                        uri=pull["uri"],
                        cid=pull["cid"],
                        title=pull.get("title", ""),
                        source=PullSource(
                            sha=source.get("sha", ""),
                            branch=source.get("branch", ""),
                            repo=source.get("repo"),
                        ),
                        target=PullTarget(
                            repo=target.get("repo", ""),
                            branch=target.get("branch", ""),
                        ),
                        createdAt=pull.get("createdAt", ""),
                    )
                )
            return cls(pulls=pulls)
  • Registration: re-exports list_repo_pulls from _pulls module in the _tangled package's public API.
    from tangled_mcp._tangled._pulls import list_repo_pulls
    
    __all__ = [
        "_get_authenticated_client",
        "get_service_token",
        "list_branches",
        "create_issue",
        "update_issue",
        "delete_issue",
        "list_repo_issues",
        "list_repo_labels",
        "list_repo_pulls",
  • Registration: re-exports ListPullsResult (and PullInfo, PullSource, PullTarget) from types package.
    from tangled_mcp.types._pulls import ListPullsResult, PullInfo, PullSource, PullTarget
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description adequately explains the behavioral limitation (only own PRs) and the reason (PRs stored in creator's repo). It does not explicitly state it is read-only, but the context implies a safe operation. Returns a ListPullsResult, which is detailed in the output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is structured with a clear statement, a note, and an Args section. It is slightly verbose due to the note, but every sentence adds value. Could be more concise without losing clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema, the description covers the purpose, parameter details, and an important behavioral limitation. No critical information is missing for an agent to correctly select and invoke this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already describes both parameters (repo format, limit range). The description repeats the format and adds a note about the repo identifier, but does not add significant new meaning beyond what the schema provides. For high coverage, this is acceptable but not exceptional.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool lists pull requests created by the authenticated user, and explicitly distinguishes it by noting the scope limitation (only own PRs). This separates it from sibling tools like list_repo_issues.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The note about only returning PRs created by the authenticated user provides important context for when to use this tool, but does not explicitly mention alternatives or when not to use it. The rationale is given, which helps in decision-making.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zzstoatzz/tangled-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server