Skip to main content
Glama
web-algebra-mcp

web-algebra-mcp

Official
by AtomGraph

ldh-AddView

Creates a LinkedDataHub view resource from an existing SPARQL SELECT query so you can display selected resources in a chosen layout like list, table, grid, map, graph, read, or chart.

Instructions

Writes a view of SPARQL SELECT query results to a LinkedDataHub document. The view is a resource the document holds, not one of its content blocks: to show it in the content mode, place it with ldh-AddObjectBlock, the view's URI as its value - so give the view a fragment identifier.

    A view shows resources - things, people, places, documents - each as itself: its label, its image,
    its links. LinkedDataHub DESCRIBEs the resources the query's first projected variable binds and renders
    those descriptions in the view's mode, so that variable must bind resources (SELECT ?thing WHERE { ... }).
    One that binds values - a name, a price, a computed total - describes nothing. To show values or
    aggregates (totals, counts, sums by month), use ldh-AddResultSetChart instead.

    A list of resources is a view even when what matters about them lives on related resources - a thing's
    shop and price on the order it came from, a message's sender on a person. Do not join those values into
    one table to show them beside each resource: select the resources, and let each one's own page show
    what it links to. Put values that summarise the related resources (spend per shop) in a chart beside it.

    This tool:
    - Creates an ldh:View resource linked to an existing sp:Select query resource
    - Configures optional display mode for the view
    - Posts the new view resource to the target document
    - Supports optional title, description, fragment identifier, and display mode

    Pick the mode by what the resources carry:
    - https://w3id.org/atomgraph/client#GridMode: a card per resource, led by its image. The fit for resources
      that have one (foaf:img, foaf:depiction, foaf:logo, schema:image, schema:logo, schema:thumbnailUrl):
      products, possessions, people, organizations
    - https://w3id.org/atomgraph/client#MapMode: a pin per resource that has geo:lat and geo:long. The fit for
      places, addresses, venues, shops
    - https://w3id.org/atomgraph/client#GraphMode: the resources and the links between them, as a network. The
      fit for showing how things connect (who owns what, what came from where)
    - https://w3id.org/atomgraph/client#ListMode: a labelled list; the default, for resources with no image or
      coordinates
    - https://w3id.org/atomgraph/client#TableMode: a row per resource, a column per property, for comparing
      many resources property by property
    - https://w3id.org/atomgraph/client#ReadMode: each resource's full description, for a few resources
    - https://w3id.org/atomgraph/client#ChartMode: the resources' properties charted

    Note: The query parameter must be a URI of an existing sp:Select resource, not a SPARQL query string.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>",
      "query": "<query>",
      "title": "<title>"
    },
    "name": "ldh-AddView"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesThe URI of the document to write the view to.
modeNoOptional URI of the layout the view shows its results in (a view mode, not an object block's mode). Defaults to ListMode. Pick it by what the resources carry: GridMode for resources with an image, MapMode for ones with coordinates, GraphMode for how they link (see the tool description).
queryYesURI of an existing sp:Select query resource to visualize (not a SPARQL query string).
titleYesTitle of the view.
fragmentNoOptional fragment identifier for the view URI (e.g., 'my-view' creates #my-view).
descriptionNoOptional description of the view.
show_when_emptyNoOptional: whether the view is shown when its query returns no results (ldh:showWhenEmpty). LinkedDataHub shows it unless this is false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.4

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it states that an ldh:View resource is created and linked to an existing sp:Select, posted to the target document, and that the query parameter must be a resource URI rather than a query string. It stops short of permissions, overwrite behaviour on an existing URI, and what the call returns.

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

Conciseness3/5

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

The purpose is front-loaded and the mode guidance is useful, but the 'This tool:' bullet list restates the opening sentence and the seven-mode enumeration repeats the enum descriptions already in the schema. Length is justified by real decision content, yet trimming the redundancy would lose nothing.

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 seven-parameter mutation tool with no annotations and no output schema, the description covers the essential decisions: which sibling to use, what the query must be, how modes map to resources, and how the view is placed. Only return value and failure/permission behaviour are absent.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description adds real meaning beyond it: the rationale for giving the view a fragment identifier so ldh-AddObjectBlock can place it, and the constraint that the first projected variable must bind resources. The mode explanations largely duplicate the enum description, which limits the credit.

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?

Opens with a specific verb and resource: writes a view of SPARQL SELECT results to a LinkedDataHub document. It immediately distinguishes itself from siblings by naming ldh-AddObjectBlock for placement and ldh-AddResultSetChart for value/aggregate visualisation.

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?

Gives explicit when-to-use and when-not-to-use guidance: the first projected variable must bind resources, values and aggregates belong in ldh-AddResultSetChart, and related values should not be joined into one table. It also routes the agent through mode selection by resource characteristics.

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