Skip to main content
Glama

ad4m_get_neighbourhood

Get a shared AD4M Neighbourhood using its Perspective UUID.

Instructions

Read a shared AD4M Neighbourhood by Perspective UUID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidYesPerspective UUID

Implementation Reference

  • The getNeighbourhood function that executes the tool logic. It calls the AD4M GraphQL API to query a perspective by UUID and returns the perspective data including uuid, name, sharedUrl, and neighbourhood info.
    async function getNeighbourhood({ uuid }) {
      const data = await gql(
        `query Perspective($uuid: String!) {
           perspective(uuid: $uuid) {
             uuid name sharedUrl neighbourhood { author timestamp }
           }
         }`,
        { uuid }
      );
      return ok(data.perspective);
    }
  • The case statement that dispatches to getNeighbourhood in the built index.js (switch-based handler dispatch).
    case "ad4m_get_neighbourhood":  return { content: await getNeighbourhood(args) };
  • index.js:564-573 (registration)
    Tool registration in the built index.js (ListToolsRequestSchema response), declaring the tool name, description, and input schema with required uuid parameter.
    {
      name: "ad4m_get_neighbourhood",
      description: "Read a shared AD4M Neighbourhood by URL. Use to inspect semantic graphs shared with other agents or communities.",
      inputSchema: {
        type: "object",
        properties: {
          uuid: { type: "string", description: "Perspective UUID" },
        },
        required: ["uuid"],
      },
  • TypeScript source registration of the tool using server.tool(), with input validation via zod schema (uuid as string) and the handler that queries the GraphQL perspective endpoint.
    // 6. ad4m_get_neighbourhood
    server.tool("ad4m_get_neighbourhood",
      "Read a shared AD4M Neighbourhood by Perspective UUID.",
      { uuid: z.string().describe("Perspective UUID") },
      async ({ uuid }) => {
        const data = await gql(
          `query Q($uuid: String!) {
             perspective(uuid: $uuid) {
               uuid name sharedUrl neighbourhood { author timestamp }
             }
           }`,
          { uuid }
        );
        return ok(data.perspective);
      }
    );
  • The 'ok' helper function used by getNeighbourhood to format the response as a text content item.
    function ok(data)  { return [{ type: "text", text: JSON.stringify(data, null, 2) }]; }
    function err(e)    { return [{ type: "text", text: JSON.stringify({ error: String(e) }) }]; }
Behavior2/5

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

No annotations provided, so the description must carry the full burden. It states 'Read' implying read-only, but it does not disclose any side effects, authorization requirements, or what the output contains. Since there is no contradiction with missing annotations, a score of 2 reflects minimal value added.

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 sentence that is clear and to the point. Every word contributes meaning without redundancy.

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?

With no output schema, the description should at least mention what is returned. It lacks any details about the return value or format. For a tool with one parameter, more context is needed for an agent to correctly interpret the result.

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?

The input schema has 100% coverage with a description for the 'uuid' parameter. The description adds 'by Perspective UUID', which essentially restates the schema. Baseline 3 is appropriate as the description does not provide additional semantic detail beyond 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 clearly states the verb 'Read' and the resource 'AD4M Neighbourhood', with the key parameter 'Perspective UUID'. It distinguishes from sibling tools like ad4m_list_perspectives by specifying a single lookup.

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?

No guidance on when to use this tool versus alternatives, nor any preconditions or context for its use. The description does not help the agent decide between this and sibling tools like ad4m_list_perspectives.

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

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/thefranceway/mcp-ad4m'

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