listGraphs
Retrieve all available graphs in a repository via GraphDB MCP Server, enabling efficient exploration and management of RDF datasets for knowledge graph analysis.
Instructions
List all graphs in the repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.ts:504-526 (handler)Handler for the 'listGraphs' tool: executes SPARQL query to fetch and return list of graphs in the repository.} else if (request.params.name === "listGraphs") { // Query to get all graphs in the repository const query = ` SELECT DISTINCT ?graph WHERE { GRAPH ?graph { ?s ?p ?o } } ORDER BY ?graph `; try { const result = await executeSparqlQuery(query); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], isError: false, }; } catch (error: any) { return { content: [{ type: "text", text: `Error listing graphs: ${error.message}` }], isError: true, }; } }
- index.ts:418-425 (registration)Tool registration in listTools response: defines name, description, and input schema for 'listGraphs'.{ name: "listGraphs", description: "List all graphs in the repository", inputSchema: { type: "object", properties: {} }, }