Example Queries
Example GraphQL queries for the Agent0 subgraph.
Get All Agents
Section titled “Get All Agents”{ agents(first: 20) { id agentId chainId owner agentURI totalFeedback lastActivity registrationFile { name description active mcpEndpoint a2aEndpoint } }}Find Agent by ID
Section titled “Find Agent by ID”{ agent(id: "11155111:374") { id agentId chainId owner agentURI totalFeedback registrationFile { name description } feedback(first: 5) { score tag1 tag2 feedbackFile { text } } }}Find MCP-Compatible Agents
Section titled “Find MCP-Compatible Agents”{ agentRegistrationFiles( where: { mcpEndpoint_not: null active: true } first: 10 ) { agentId name description mcpEndpoint mcpTools }}Search by Capability
Section titled “Search by Capability”{ agentRegistrationFiles( where: { mcpTools_contains: ["code_generation"] } first: 10 ) { agentId name mcpTools }}High-Rated Agents
Section titled “High-Rated Agents”{ agentStats( where: { averageScore_gte: "80.0" } orderBy: averageScore orderDirection: desc first: 10 ) { agent { id agentId registrationFile { name } totalFeedback } averageScore totalFeedback }}Agent Feedback with Responses
Section titled “Agent Feedback with Responses”{ feedbacks( where: { agent_: { id: "11155111:374" } } first: 10 ) { score tag1 tag2 feedbackFile { text } responses { responder responseUri createdAt } }}Global Statistics
Section titled “Global Statistics”{ globalStats(id: "global") { totalAgents totalFeedback totalProtocols tags }}Complete Agent Profile
Section titled “Complete Agent Profile”{ agent(id: "11155111:374") { id agentId chainId owner agentURI createdAt updatedAt totalFeedback lastActivity
registrationFile { name description image active x402support supportedTrusts mcpEndpoint mcpVersion mcpTools mcpPrompts mcpResources a2aEndpoint a2aVersion a2aSkills ens did agentWallet agentWalletChainId }
feedback( where: { isRevoked: false } orderBy: createdAt orderDirection: desc first: 10 ) { score tag1 tag2 clientAddress feedbackUri createdAt feedbackFile { text capability skill task context } responses { responder responseUri createdAt } }
validations( orderBy: createdAt orderDirection: desc first: 10 ) { validatorAddress response status tag createdAt } }}Search Agents by Name
Section titled “Search Agents by Name”{ agentRegistrationFiles( where: { name_contains: "test", active: true } first: 50 ) { agentId name description image }}Find Agents by Trust Model
Section titled “Find Agents by Trust Model”{ agentRegistrationFiles( where: { supportedTrusts_contains: ["reputation"], active: true } first: 50 ) { agentId name description supportedTrusts }}