Skip to main content
Glama

list_schemas

Lists all loaded schemas with names, descriptions, and types (note or folder) to help you understand available conventions.

Instructions

Lists all loaded schemas. No arguments. Returns { root, schemas[] } where each schema has name, description, type (note|folder), and type-specific details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for list_schemas tool. Calls services.schema.refresh() then listSchemas() and returns the list of loaded schemas.
    function makeListSchemasTool(container: ServiceContainer): ToolHandler {
      return {
        name: "list_schemas",
        description:
          "Lists all loaded schemas. No arguments. Returns `{ root, schemas[] }` where each schema has `name`, `description`, `type` (`note`|`folder`), and type-specific details.",
        inputSchema: ListSchemasSchema,
        async handler(_args): Promise<ToolResponse> {
          try {
            const services = requireServices(container);
            log.info("list_schemas called");
            await services.schema.refresh();
            const schemas = services.schema.listSchemas();
            log.info({ count: schemas.length }, "list_schemas complete");
            return {
              content: [{ type: "text", text: JSON.stringify({ root: getRoot(container), schemas }, null, 2) }],
            };
          } catch (err) {
            log.error({ err }, "list_schemas failed");
            return {
              content: [{ type: "text", text: JSON.stringify({
                root: getRoot(container),
                error: err instanceof Error ? err.message : String(err),
                possibleSolutions: ["Check the schemas directory is configured correctly", "Verify schema YAML files are valid"],
              }) }],
              isError: true,
            };
          }
        },
      };
    }
  • Input schema for list_schemas — takes no arguments (empty object).
    const ListSchemasSchema = z.object({});
  • Registration function that registers list_schemas (and other schema tools) into the tool registry map.
    export function registerSchemaTools(
      registry: Map<string, ToolHandler>,
      container: ServiceContainer,
    ): void {
      const tools = [
        makeLintNoteTool(container),
        makeValidateFolderTool(container),
        makeValidateAreaTool(container),
        makeValidateAllTool(container),
        makeListSchemasTool(container),
      ];
    
      for (const tool of tools) {
        registry.set(tool.name, tool);
      }
    }
  • Whitelist entry — list_schemas is exposed in --lite mode as part of schema lint tools.
    export const LITE_TOOL_NAMES: ReadonlySet<string> = new Set([
      // Schema / lint
      "lint_note",
      "validate_folder",
      "validate_area",
      "validate_all",
      "list_schemas",
      // Link graph
      "find_broken_links",
      "find_orphans",
      "find_unlinked_mentions",
      "find_bidirectional_mentions",
      "get_backlinks",
  • Implements SchemaEngine.listSchemas(), delegates to SchemaRegistry.listAll() to collect all loaded schemas.
      listSchemas(): SchemaInfo[] {
        return this.registry.listAll();
      }
    
      // ==========================================================================
      // Private helpers
      // ==========================================================================
    
      private async lintNoteWithPreRead(
        notePath: string,
        preReadNote?: ParsedNote,
        vaultIndex?: VaultIndex,
      ): Promise<LintResult> {
        if (preReadNote) {
          let schema: NoteSchema | null = null;
          if (typeof preReadNote.frontmatter.note_schema === "string") {
            schema = this.registry.getNoteSchema(preReadNote.frontmatter.note_schema);
          }
          if (!schema) {
            schema = this.resolveNoteSchema(notePath);
          }
          return this.noteEngine.lintNote(notePath, schema, preReadNote, vaultIndex);
        }
        return this.lintNote(notePath);
      }
    
      /**
       * True if any registered note schema has a `noBrokenWikilinks` content rule.
       * Used to skip the O(N) vault read when no folder/area validation needs it.
       */
      private schemaNeedsVaultIndex(schema: NoteSchema): boolean {
        return schema.content.rules.some((r) => r.check === "noBrokenWikilinks");
      }
    
      private anyRegisteredSchemaNeedsVaultIndex(): boolean {
        for (const info of this.registry.listAll()) {
          if (info.type !== "note") continue;
          const noteSchema = this.registry.getNoteSchema(info.name);
          if (noteSchema && this.schemaNeedsVaultIndex(noteSchema)) return true;
        }
        return false;
      }
    
      /**
       * Build a vault index once if any note schema relies on `noBrokenWikilinks`.
       * Returns undefined when the index would be unused — saves an O(N) read pass.
       */
      private async maybeBuildVaultIndex(): Promise<VaultIndex | undefined> {
        if (!this.anyRegisteredSchemaNeedsVaultIndex()) return undefined;
        return await buildVaultIndex(this.file);
      }
    
      private isLikelyHub(notePath: string, folderSchema: FolderSchema): boolean {
        if (!folderSchema.hub?.detection) return false;
        const folderName = path.basename(path.dirname(normalizePath(notePath)));
        const filename = path.basename(notePath);
        for (const rule of folderSchema.hub.detection) {
          if ("pattern" in rule) {
            const target = expandHubPattern(rule.pattern, folderName);
            if (filename === target) return true;
          }
          // Skip fallback rules — full detection runs during validateFolder
        }
        return false;
      }
    
    }
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses return format `{ root, schemas[] }` with schema details, which is good transparency for a read-only list operation. No side effects noted, but none expected.

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?

Two sentences, front-loaded with the action, no redundant words. Every part earns its place.

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 simple, parameterless tool with no output schema, the description provides the return structure and schema fields, which is fairly complete. Could optionally mention that it's safe to call anytime, but not necessary.

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?

Zero parameters; schema coverage is 100% (empty object). Description confirms 'No arguments,' adding clarity beyond the schema. Baseline for 0 params is 4.

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?

Clearly states the function: 'Lists all loaded schemas.' Uses specific verb and resource, distinguishing it from all sibling tools, which deal with notes, directories, or other operations.

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?

Explicitly notes 'No arguments,' which is a clear usage constraint. However, it does not provide context on when to use vs. not, or compare to alternatives; but given the unique function, this is sufficient.

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/Erodenn/markscribe'

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