Skip to main content
Glama

list_projects

List all registered projects with id, name, path, and has_hands flag to obtain project_id for scoped tools.

Instructions

List every registered project with id, name, absolute path, and a derived has_hands flag (true when the path exists on disk AND contains a ctxnest.json). Read-only; no side effects, auth, or rate limits. Use to find the project_id to pass to scoped tools (search, list_files, commit_backup, refresh_index, etc.). To register a new project use register_project; to inspect its Hands tools use list_hands.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'list_projects'. Calls listProjects() from core, augments each project with a 'has_hands' flag (true if path exists and contains ctxnest.json), and returns the JSON result.
    server.tool(
      "list_projects",
      "List every registered project with id, name, absolute path, and a derived `has_hands` flag (true when the path exists on disk AND contains a `ctxnest.json`). Read-only; no side effects, auth, or rate limits. Use to find the project_id to pass to scoped tools (`search`, `list_files`, `commit_backup`, `refresh_index`, etc.). To register a new project use `register_project`; to inspect its Hands tools use `list_hands`.",
      {},
      async () => {
        const result = listProjects();
        const augmented = result.map((p: any) => ({
          ...p,
          has_hands: !!(p.path && existsSync(p.path) && existsSync(`${p.path}/ctxnest.json`)),
        }));
        return {
          content: [{ type: "text", text: JSON.stringify(augmented, null, 2) }],
        };
      }
    );
  • The list_projects tool takes no parameters (empty schema object {}).
    {},
  • Tool registered via server.tool('list_projects', ...) on the McpServer instance.
    server.tool(
      "list_projects",
      "List every registered project with id, name, absolute path, and a derived `has_hands` flag (true when the path exists on disk AND contains a `ctxnest.json`). Read-only; no side effects, auth, or rate limits. Use to find the project_id to pass to scoped tools (`search`, `list_files`, `commit_backup`, `refresh_index`, etc.). To register a new project use `register_project`; to inspect its Hands tools use `list_hands`.",
      {},
      async () => {
        const result = listProjects();
        const augmented = result.map((p: any) => ({
          ...p,
          has_hands: !!(p.path && existsSync(p.path) && existsSync(`${p.path}/ctxnest.json`)),
        }));
        return {
          content: [{ type: "text", text: JSON.stringify(augmented, null, 2) }],
        };
      }
    );
  • Core implementation: queries the projects table from SQLite, ordered by name, and returns all ProjectRecord rows.
    export function listProjects(): ProjectRecord[] {
      const db = getDatabase();
      const stmt = db.prepare("SELECT * FROM projects ORDER BY name");
      return stmt.all() as ProjectRecord[];
    }
  • Re-exports listProjects from metadata module so it's available as a public API of ctxnest-core.
      addTags, removeTags, setFavorite, search,
      registerProject, unregisterProject, discoverFiles, listTags, listProjects,
      findRelated, getTagsForFiles, type RelatedFileRecord,
    } from "./metadata/index.js";
Behavior5/5

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

Even without annotations, the description explicitly declares read-only nature, no side effects, no auth, no rate limits, providing complete behavioral transparency.

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: first states purpose and output, second gives usage context and sibling differentiation. No wasted words.

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 parameterless tool with no output schema, the description fully explains what is returned (including the derived flag) and how to use the results with other tools.

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?

No parameters; schema coverage 100%. The description adds meaning by explaining the derived has_hands flag, which goes beyond the empty 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 tool lists every registered project with specific fields (id, name, absolute path, has_hands flag). It distinguishes from siblings like register_project and list_hands.

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?

Explicitly states when to use (to find project_id for scoped tools) and provides alternatives: register_project for new projects, list_hands for inspecting Hands tools.

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/safiyu/ctxnest'

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