Skip to main content
Glama

list_repo_issues

List issues for a Tangled repository by specifying the owner/repo identifier. Optionally set the maximum number of issues to return (1-100).

Instructions

list issues for a repository

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

Returns: ListIssuesResult with list of issues

Input Schema

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
issuesYes

Implementation Reference

  • MCP tool handler that resolves repo identifier, calls _tangled.list_repo_issues(), and wraps the result in ListIssuesResult.
    @tangled_mcp.tool
    def list_repo_issues(
        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 issues to return")
        ] = 20,
    ) -> ListIssuesResult:
        """list issues for a repository
    
        Args:
            repo: repository identifier in 'owner/repo' format
            limit: maximum number of issues to return (1-100)
    
        Returns:
            ListIssuesResult with list of issues
        """
        # resolve owner/repo to (knot, did/repo)
        _, repo_id = _tangled.resolve_repo_identifier(repo)
        # list_repo_issues doesn't need knot (queries atproto records, not XRPC)
        response = _tangled.list_repo_issues(repo_id, limit, cursor=None)
    
        return ListIssuesResult.from_api_response(response)
  • Core implementation that queries AT Protocol to list issues. Resolves repo AT-URI, lists issue records from 'sh.tangled.repo.issue' collection, filters by repo, and fetches label ops to populate issue labels.
    def list_repo_issues(
        repo_id: str, limit: int = 50, cursor: str | None = None
    ) -> dict[str, Any]:
        """list issues for a repository
    
        Args:
            repo_id: repository identifier in "did/repo" format
            limit: maximum number of issues to return
            cursor: pagination cursor
    
        Returns:
            dict containing issues and optional cursor
        """
        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 records from the issue collection
        response = client.com.atproto.repo.list_records(
            models.ComAtprotoRepoListRecords.Params(
                repo=client.me.did,
                collection="sh.tangled.repo.issue",
                limit=limit,
                cursor=cursor,
            )
        )
    
        # filter issues by repo
        issues = []
        issue_uris = []
        for record in response.records:
            if (
                repo := getattr(record.value, "repo", None)
            ) is not None and repo == repo_at_uri:
                issue_uris.append(record.uri)
                issues.append(
                    {
                        "uri": record.uri,
                        "cid": record.cid,
                        "issueId": getattr(record.value, "issueId", 0),
                        "title": getattr(record.value, "title", ""),
                        "body": getattr(record.value, "body", None),
                        "createdAt": getattr(record.value, "createdAt", ""),
                        "labels": [],  # will be populated below
                    }
                )
    
        # fetch label ops and correlate with issues
        if issue_uris:
            label_ops = client.com.atproto.repo.list_records(
                models.ComAtprotoRepoListRecords.Params(
                    repo=client.me.did,
                    collection="sh.tangled.label.op",
                    limit=100,
                )
            )
    
            # build map of issue_uri -> current label URIs
            issue_labels_map: dict[str, set[str]] = {uri: set() for uri in issue_uris}
            for op_record in label_ops.records:
                if (
                    hasattr(op_record.value, "subject")
                    and op_record.value.subject in issue_labels_map
                ):
                    subject_uri = op_record.value.subject
                    if hasattr(op_record.value, "add"):
                        for operand in op_record.value.add:
                            if hasattr(operand, "key"):
                                issue_labels_map[subject_uri].add(operand.key)
                    if hasattr(op_record.value, "delete"):
                        for operand in op_record.value.delete:
                            if hasattr(operand, "key"):
                                issue_labels_map[subject_uri].discard(operand.key)
    
            # extract label names from URIs and add to issues
            for issue in issues:
                label_uris = issue_labels_map.get(issue["uri"], set())
                issue["labels"] = [uri.split("/")[-1] for uri in label_uris]
    
        return {"issues": issues, "cursor": response.cursor}
  • ListIssuesResult Pydantic model with from_api_response() classmethod that parses raw API response into IssueInfo objects, filtering out malformed issues.
    class ListIssuesResult(BaseModel):
        """result of listing issues"""
    
        issues: list[IssueInfo]
    
        @classmethod
        def from_api_response(cls, response: dict[str, Any]) -> "ListIssuesResult":
            """construct from raw API response
    
            Args:
                response: raw response from tangled API with structure:
                    {
                        "issues": [
                            {
                                "uri": "at://...",
                                "cid": "bafyrei...",
                                "issueId": 1,
                                "title": "...",
                                "body": "...",
                                "createdAt": "..."
                            },
                            ...
                        ]
                    }
    
            Returns:
                ListIssuesResult with parsed issues
            """
            issues = []
            for issue_data in response.get("issues", []):
                # skip malformed issues (e.g., missing issueId)
                if issue_data.get("issueId") is None:
                    continue
                issues.append(IssueInfo(**issue_data))
            return cls(issues=issues)
  • Re-exports list_repo_issues from _issues module and includes it in __all__ for public API access.
    from tangled_mcp._tangled._issues import (
        create_issue,
        delete_issue,
        list_repo_issues,
        list_repo_labels,
        update_issue,
    )
    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",
  • Test asserting that list_repo_issues is present in the server's exposed tools.
    assert "list_repo_issues" in tool_names
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It only states that it lists issues, without mentioning read-only nature, authentication needs, rate limits, or any ordering. The output schema exists but the description does not add behavioral context beyond the action.

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 concise and uses a clear structure (Args, Returns). It is front-loaded with the main action. Only slightly impacted by using Python docstring style which may not be universal.

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

Completeness4/5

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

For a simple list tool with an output schema, the description covers the essential parameters and purpose. It does not mention default ordering or filtering (e.g., state), but the schema limits scope. Completeness is adequate given the tool's simplicity.

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 input schema already documents both parameters (repo, limit). The description adds a format hint for repo but otherwise repeats schema info. It does not significantly enhance understanding beyond what the schema provides.

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?

The description clearly states 'list issues for a repository', providing a specific verb and resource. It distinguishes itself from sibling tools (create, delete, update) and other list tools (branches, labels, pulls).

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

Usage Guidelines3/5

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

The description does not explicitly guide when to use this tool versus alternatives. While the purpose is implied, there is no mention of when not to use it or comparison with sibling tools. Usage is clear from context but lacks explicit guidance.

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