Skip to main content
Glama
softagram

SGraph MCP Server

Official
by softagram

sgraph_query

Filter architecture models by path, attribute, or dependency using SGraph Query Language, returning matching elements and associations for impact analysis.

Instructions

Filter the model using SGraph Query Language — concise, architecture-native syntax.

Best for: filtering sub-models, checking module dependencies, attribute-based element selection. Returns a filtered model (elements + associations), not tabular data. For tabular queries and aggregation, use sgraph_cypher_query instead.

Syntax quick reference:

Element selection: "/project/src/web" Exact path (quoted, case-sensitive) phone Keyword (unquoted, case-insensitive partial match) "/path/*" Direct children "/path/**" All descendants

Attribute filters: @type=file Attribute equals (contains match) @type="file" Exact match (quoted value) @type!=dir Not equals @loc>500 Greater than (numeric) @loc<100 Less than @name=~".*.py$" Regex match @loc Has attribute (any value)

Dependency queries: "/src/web" --> "/src/db" Directed: does web depend on db? "/src/web" -- "/src/db" Undirected: dependency in either direction "/web" -import-> "/db" Filter by dependency type "*" --> "/src/db" Wildcard: anything that depends on db "/a" ---> "/b" Chain search: all transitive paths (DFS) "/a" --import-> "/b" Chain with type filter "/a" --- "/b" Shortest undirected path (BFS)

Logical operators: expr1 AND expr2 Sequential filter (intersection) expr1 OR expr2 Union NOT expr Complement (expr) Grouping

Examples: @type=file AND @loc>500 "/src" AND NOT "/src/External" "/src/web" --> "/src/db" (@type=file OR @type=dir) AND @loc>200

Returns JSON with elements (path, type, name) and associations (from, to, type).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations provided, the description carries the disclosure burden. It clearly states the return type: 'Returns a filtered model (elements + associations), not tabular data' and specifies the JSON shape. It also documents case-sensitive and case-insensitive matching behaviors. It stops short of explicitly stating that the tool has no side effects, though 'query' and 'filter' imply a read-only operation.

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 long but every section earns its place: a query language reference requires syntax examples and operator explanations. The purpose and return type are front-loaded, and the syntax reference is clearly organized with headings. It is dense but not padded.

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 complex tool with no output schema and no annotations, the description is remarkably complete: it explains syntax, operators, examples, and return structure. It does not cover edge cases, error behavior, or how model_id interacts with the default model, but these are minor for selecting and invoking the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds substantial meaning to the expression parameter, offering a full syntax quick reference with element selection, attribute filters, dependency queries, logical operators, and examples. The optional model_id parameter is adequately explained in the schema itself, so the description's focus on the required expression parameter is appropriate.

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 opens with a specific verb and resource: 'Filter the model using SGraph Query Language' and lists concrete use cases: filtering sub-models, checking module dependencies, and attribute-based element selection. It also explicitly contrasts the tool with sgraph_cypher_query, making the distinction clear.

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

Usage Guidelines5/5

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

The description says 'Best for' and explicitly directs users needing tabular queries and aggregation to sgraph_cypher_query instead. It also gives query-category examples that clarify when this tool is appropriate versus structural alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/softagram/sgraph-mcp-server'

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