Skip to main content
Glama

Get Pathrule Context

pathrule_get_context
Read-only

Return Pathrule context for a workspace path: relevant memories, rules, skills, subtree index, and a next_required_action hint. Remote clients must pass workspace_id; call pathrule_list_workspaces first when unsure. No cwd or local_root_path is used. The response includes a local_runtime.cta line — surface it when the user could benefit from Pathrule Studio's hooks, CLAUDE.md/AGENTS.md sync, or on-disk skills.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
node_pathNoWorkspace-relative path such as '/' or '/packages/app'. Defaults to '/'.
user_intentNoThe user's current request, if available.
workspace_idYesWorkspace UUID from pathrule_list_workspaces.
known_protocol_versionNoPass the protocol_version already cached by the client to omit repeats.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYestrue when the call succeeded. false when it did not, in which case `error` carries the reason and the success fields are absent.
errorNoPresent only when ok is false.
protocolNoFull protocol text. Sent only when the client did not already hold this protocol_version.
workspace_idNoWorkspace the context was resolved in.
local_runtimeNoPresent on tools that carry the local-runtime upgrade reminder.
protocol_versionNoVersion of the Pathrule agent protocol this response was built against. Cache it and pass it back as known_protocol_version.
protocol_unchangedNoPresent when known_protocol_version matched, meaning `protocol` was omitted on purpose.

Schema Changelog

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

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": true,
      +  "description": "Router response. The remaining keys are depth-dependent and come from the shared context handler: memories, rules, skills, subtree_memory_index, discovery_signal, semantic_candidates, and next_required_action are the ones clients rely on, and which of them appear depends on the classified intent.",
      +  "properties": {
      +    "error": {
      +      "additionalProperties": true,
      +      "description": "Present only when ok is false.",
      +      "properties": {
      +        "code": {
      +          "description": "Stable machine-readable failure code, for example insufficient_scope, workspace_id_required, rate_limited, not_found, or upstream_error. Branch on this, not on message text.",
      +          "type": "string"
      +        },
      +        "detail": {
      +          "description": "Optional structured context for the failure, for example { missing_scopes: [...] } on insufficient_scope."
      +        },
      +        "message": {
      +          "description": "Human-readable explanation of the failure.",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "code",
      +        "message"
      +      ],
      +      "type": "object"
      +    },
      +    "local_runtime": {
      +      "additionalProperties": true,
      +      "description": "Present on tools that carry the local-runtime upgrade reminder.",
      +      "properties": {
      +        "cta": {
      +          "description": "Upgrade line to surface to the user when local Pathrule (Studio or CLI) would serve them better than Remote MCP.",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "cta"
      +      ],
      +      "type": "object"
      +    },
      +    "ok": {
      +      "description": "true when the call succeeded. false when it did not, in which case `error` carries the reason and the success fields are absent.",
      +      "type": "boolean"
      +    },
      +    "protocol": {
      +      "description": "Full protocol text. Sent only when the client did not already hold this protocol_version."
      +    },
      +    "protocol_unchanged": {
      +      "const": true,
      +      "description": "Present when known_protocol_version matched, meaning `protocol` was omitted on purpose.",
      +      "type": "boolean"
      +    },
      +    "protocol_version": {
      +      "description": "Version of the Pathrule agent protocol this response was built against. Cache it and pass it back as known_protocol_version.",
      +      "type": "string"
      +    },
      +    "workspace_id": {
      +      "description": "Workspace the context was resolved in.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "ok"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

The annotations already provide readOnlyHint=true and destructiveHint=false. The description adds useful behavior beyond that: it ignores cwd/local_root_path and includes a local_runtime.cta line in the response. There is no contradiction with the annotations.

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 four purposeful sentences, front-loaded with the core behavior and environment assumptions. The CTA/response note is slightly dense but relevant to downstream user interaction; no words are wasted.

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

Completeness5/5

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

An output schema exists and annotations cover the safety profile. The description covers prerequisites, workspace_id handling, the no-cwd behavior, and a special response line. Nothing needed to call the tool correctly is missing.

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 the baseline is 3. The description adds meaning for workspace_id by flagging it as required for remote clients and linking it to pathrule_list_workspaces, and clarifies that cwd/local_root_path are not used. It does not elaborate on node_path, user_intent, or known_protocol_version, but those are already documented in the schema.

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 uses a specific verb ('Return') and resource ('Pathrule context for a workspace path'), and enumerates the contents: memories, rules, skills, subtree index, and a next_required_action hint. This clearly distinguishes it from related get/list sibling tools.

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

Usage Guidelines4/5

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

It gives clear context: remote clients must pass workspace_id, and should call pathrule_list_workspaces first when unsure. It also states that cwd/local_root_path is not used. It does not explicitly name alternatives or when-not-to-use cases, but the prerequisite guidance is useful.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A3.8/5.0
Disambiguation4/5

Tools are grouped by resource (memory/rule/skill/workspace/snapshot/refresh) and mostly have distinct output shapes, so agents can usually pick the right one. A few retrieval tools (get_context, get_node, get_tree, goto) overlap in purpose, but their descriptions clarify resolution mode vs full tree vs context bundle.

Naming Consistency3/5

All tools share the pathrule_ prefix and mostly follow verb_noun, but the verbs are inconsistent: create_workspace vs write_memory, get_node vs read_memory, delete_skill vs remove_pattern, plus verb-only exceptions like goto, setup, and ping. The pattern is readable but not uniform.

Tool Count2/5

32 tools is above the 25-tool threshold and feels heavy for a single server, even with a broad domain. Several context-retrieval tools and read/list variants could potentially be consolidated, though each tool does have a specific purpose.

Completeness4/5

Core CRUD is covered for memories, rules, and skills, along with workspaces, snapshots, refresh tasks, and pattern import/removal. Minor gaps include no standalone list_rules/list_skills and no snapshot update/delete, but agents can work around these via get_context, goto, and get_tree.

Resources