Skip to main content
Glama

mcp_sparql_list_graphs

List all named graphs in a specified repository using SPARQL queries to manage and explore ontology data efficiently on the Ontology MCP server.

Instructions

지정된 리포지토리의 모든 명명된 그래프를 나열합니다

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endpointNoSPARQL 엔드포인트 URL
repositoryNo그래프를 조회할 리포지토리 이름

Implementation Reference

  • The main handler function for the 'mcp_sparql_list_graphs' tool. It creates a SparqlService instance if endpoint provided, calls listGraphs method, formats result as JSON and returns as ToolResponse.
    async handler(args: ListGraphsArgs): Promise<ToolResponse> {
      try {
        if (args.endpoint) {
          const service = new SparqlService({
            endpoint: args.endpoint,
            defaultRepository: args.repository || ''
          });
          const graphs = await service.listGraphs(args.repository);
          return {
            content: [{
              type: 'text',
              text: JSON.stringify(graphs, null, 2)
            }]
          };
        } else {
          const graphs = await sparqlService.listGraphs(args.repository);
          return {
            content: [{
              type: 'text',
              text: JSON.stringify(graphs, null, 2)
            }]
          };
        }
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `그래프 목록 조회 오류: ${error instanceof Error ? error.message : String(error)}`
          }]
        };
      }
    }
  • Input schema definition for the tool parameters: optional repository and endpoint.
    inputSchema: {
      type: 'object',
      properties: {
        repository: {
          type: 'string',
          description: '그래프를 조회할 리포지토리 이름'
        },
        endpoint: {
          type: 'string',
          description: 'SPARQL 엔드포인트 URL'
        }
      },
      required: []
    },
  • SparqlService.listGraphs method that executes a SPARQL query to list distinct named graphs in the repository.
    async listGraphs(repository?: string): Promise<any> {
      const repo = repository || this.config.defaultRepository;
      
      try {
        const response = await this.executeQuery(`
          SELECT DISTINCT ?graph 
          WHERE { 
            GRAPH ?graph { ?s ?p ?o } 
          } 
          ORDER BY ?graph
        `, repo);
        
        return response;
      } catch (error) {
        throw new Error(`그래프 목록 조회 오류: ${error}`);
      }
    }
  • src/index.ts:29-29 (registration)
    Registration in MCP server capabilities indicating the tool is available.
    mcp_sparql_list_graphs: true,
  • TypeScript interface defining the input arguments for the tool.
    export interface ListGraphsArgs {
      repository?: string;
      endpoint?: string;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't mention whether it's read-only, what permissions are needed, what format the output returns, or any rate limits. This leaves significant behavioral gaps for a tool with zero annotation coverage.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded with the essential information.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the output looks like (e.g., list format, error handling) or provide behavioral context needed for proper tool invocation, especially for a tool with sibling alternatives in the same domain.

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 description coverage is 100%, so the schema already documents both parameters (endpoint and repository) adequately. The description adds no additional parameter semantics beyond what's in the schema, meeting the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the action ('lists all named graphs') and the target resource ('specified repository'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like mcp_sparql_list_repositories or mcp_sparql_get_resource_info, which prevents a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. There are no explicit when/when-not instructions or references to sibling tools like mcp_sparql_list_repositories or mcp_sparql_execute_query, leaving usage context unclear.

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

Related 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/bigdata-coss/agent_mcp'

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