Skip to main content
Glama

list_candidates

Retrieve relevant documents for a query to prepare high-quality indexable artifacts in traceable documentary corpora.

Instructions

List candidate documents for a query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kwargsYes

Implementation Reference

  • The MCP handler that processes the 'list_candidates' tool request by calling the orchestrator's list_candidates method.
    def _list_candidates(orchestrator: Orchestrator, _db: Session, _settings: AppSettings, arguments: dict[str, Any]) -> Any:
        query_id = arguments["query_id"]
        return [
            {
                "id": candidate.id,
                "title": candidate.title,
                "status": candidate.status,
                "domain": candidate.domain,
                "source_url": candidate.source_url,
            }
            for candidate in orchestrator.list_candidates(query_id)
        ]
  • Registration of the 'list_candidates' tool in the MCP registry.
        name="list_candidates",
        title="List Candidates",
        description="List candidate documents for a query.",
        version="1.0.0",
        input_schema={"type": "object", "properties": {"query_id": {"type": "string"}}, "required": ["query_id"]},
        output_schema={"type": "array"},
        security=common_security,
        handler=_list_candidates,
    ),
  • The business logic implementation of list_candidates within the Orchestrator service.
    def list_candidates(self, query_id: str) -> list[CandidateDocument]:
        return list(self.session.scalars(select(CandidateDocument).where(CandidateDocument.query_id == query_id).order_by(CandidateDocument.discovery_rank)))

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/fbailleux2/kfabric'

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