Skip to main content
Glama

Search the AD catalogue

search
Read-onlyIdempotent

Inspect a domain's Active Directory schema catalogue to find classes, attributes, LDAP controls, extended rights, and policy settings before scripting AD changes.

Instructions

Search one domain's Active Directory catalogue: every class and attribute in its schema, which attributes are confidential, each attribute's syntax and whether it holds one value, which attributes a class may hold, the LDAP controls the domain controller supports, and the extended rights. Use it before execute to find the right attribute or class rather than guessing.

The catalogue is read from the domain the first time you search it, which takes a few seconds, and kept for the session. Pass refresh: true after a schema change. Your script runs with no network and cannot reach the domain.

Write the body of an async function and "return" the value you want back. Output is capped at about 10,000 tokens, so filter inside the script.

Available in the script: declare const catalogue: { domain: string; readAt: string; dc: string; schemaNamingContext: string; forestFunctionality: number; domainFunctionality: number; // 10 = Windows Server 2025 attributes: Record<string, { // keyed by lDAPDisplayName, e.g. "member" oid: string; guid?: string; syntax: string; // e.g. "DN", "UnicodeString", "LargeInteger", "SID" single: boolean; confidential?: true; indexed?: true; systemOnly?: true; linkID?: number; range?: [number | null, number | null]; propertySet?: string; description?: string; }>; classes: Record<string, { // keyed by lDAPDisplayName, e.g. "user" oid: string; guid?: string; kind: "structural" | "abstract" | "auxiliary" | "88"; parent: string; must: string[]; may: string[]; // including inherited and auxiliary-class attributes auxiliary: string[]; possibleSuperiors: string[]; description?: string; }>; controls: Array<{ oid: string; name?: string }>; // what the DC supports extendedRights: Record<string, { // keyed by name, e.g. "User-Force-Change-Password" displayName: string; guid: string; kind: "control" | "propertySet" | "validatedWrite" | "other"; appliesTo: string[]; }>; // Policy settings from the ADMX files (the domain's central store, or the local PolicyDefinitions). // To set one with gpo.set, prefix key with HKLM\ for class Machine or HKCU\ for class User. // A policy's own valueName is set to 1 to enable it; elements are its extra values. policies: Array<{ name: string; displayName: string; class: "Machine" | "User" | "Both"; key: string; valueName?: string; category: string; file: string; elements: Array<{ type: string; id?: string; valueName?: string; key?: string }> }>; policiesSource?: string; policiesError?: string; };

Examples: // Confidential attributes return Object.entries(catalogue.attributes).filter(([, a]) => a.confidential).map(([n]) => n);

// Attributes about passwords, with their syntax return Object.entries(catalogue.attributes).filter(([n]) => /pwd|password/i.test(n)).map(([n, a]) => ({ n, syntax: a.syntax, single: a.single }));

// Everything a user object may hold return catalogue.classes.user.may.length;

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesBody of an async JavaScript function over `catalogue`. Return a value.
domainYesConnection alias or the domain's DNS name. See connections_list.
refreshNoRead the catalogue from the domain again. Defaults to false.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
logsYes
errorNo
domainYes
resultNo
truncatedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.8/5.0
Behavior5/5

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

Goes well past the annotations: first read is slow (a few seconds) and then cached per session, refresh semantics, ~10,000 token output cap with 'filter inside the script' advice, and the no-network sandbox constraint. These are execution-relevant traits the readOnly/idempotent hints cannot convey.

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?

Purpose and the search-before-execute rule are front-loaded, but the definition is long and carries a full TypeScript type block plus three examples. Every part is arguably load-bearing for writing a correct script, yet the examples could be trimmed without losing an agent's ability to call it.

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?

For a code-execution tool with an output schema, the description supplies exactly what is missing elsewhere: the catalogue's structure, its caching lifecycle, network isolation, and the output cap. Nothing an agent needs to write a valid script is 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 the baseline is 3, but the description contributes real meaning beyond it: `code` must be the body of an async function that returns a value, and the full shape of the injected `catalogue` object is documented with worked examples. `refresh` and `domain` are covered by the schema description, so this stays a 4 rather than a 5.

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?

Names a specific verb and resource (search one domain's AD catalogue) and enumerates exactly what is covered: classes, attributes, confidentiality, syntax, single-valuedness, class-attribute links, LDAP controls, extended rights. It also routes the agent relative to its sibling: 'Use it before execute to find the right attribute or class rather than guessing.'

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?

Explicit sequencing guidance (search before execute), an explicit refresh condition ('Pass refresh: true after a schema change'), and an exclusion ('Your script runs with no network and cannot reach the domain'). The agent knows when this tool is the right one and when it must fall back.

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