Skip to main content
Glama

basecamp_list_projects

Retrieve all active Basecamp projects with IDs and metadata to access project resources like messages and todos.

Instructions

List all projects visible to the authenticated user in a Basecamp account. This tool returns active projects with their IDs, names, descriptions, and metadata. Use this to discover project/bucket IDs needed for accessing messages, todos, and other resources.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoOptional regular expression to filter projects by name or description

Implementation Reference

  • Handler function for basecamp_list_projects tool: initializes Basecamp client, fetches all projects using pagination, applies optional filter, returns JSON list of project details or error message.
    async (params) => {
      try {
        const client = await initializeBasecampClient();
    
        // Fetch projects with pagination
        const projects = await asyncPagedToArray({
          fetchPage: client.projects.list,
          request: {
            query: {},
          },
        });
    
        // Apply filter if provided
        let filteredProjects = projects;
        if (params.filter) {
          const regex = new RegExp(params.filter, "i");
          filteredProjects = projects.filter(
            (p) => regex.test(p.name) || regex.test(p.description || ""),
          );
        }
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                filteredProjects.map((p) => ({
                  id: p.id,
                  name: p.name,
                  description: p.description || "",
                  created_at: p.created_at,
                  updated_at: p.updated_at,
                  url: p.app_url,
                })),
                null,
                2,
              ),
            },
          ],
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: handleBasecampError(error) }],
        };
      }
    },
  • Input schema definition using Zod: optional 'filter' string for regex filtering projects.
    inputSchema: {
      filter: z
        .string()
        .optional()
        .describe(
          "Optional regular expression to filter projects by name or description",
        ),
    },
  • Tool registration call for 'basecamp_list_projects' including name, title, description, inputSchema, annotations, and handler function.
    server.registerTool(
      "basecamp_list_projects",
      {
        title: "List Basecamp Projects",
        description: `List all projects visible to the authenticated user in a Basecamp account. This tool returns active projects with their IDs, names, descriptions, and metadata. Use this to discover project/bucket IDs needed for accessing messages, todos, and other resources.`,
        inputSchema: {
          filter: z
            .string()
            .optional()
            .describe(
              "Optional regular expression to filter projects by name or description",
            ),
        },
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: true,
        },
      },
      async (params) => {
        try {
          const client = await initializeBasecampClient();
    
          // Fetch projects with pagination
          const projects = await asyncPagedToArray({
            fetchPage: client.projects.list,
            request: {
              query: {},
            },
          });
    
          // Apply filter if provided
          let filteredProjects = projects;
          if (params.filter) {
            const regex = new RegExp(params.filter, "i");
            filteredProjects = projects.filter(
              (p) => regex.test(p.name) || regex.test(p.description || ""),
            );
          }
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(
                  filteredProjects.map((p) => ({
                    id: p.id,
                    name: p.name,
                    description: p.description || "",
                    created_at: p.created_at,
                    updated_at: p.updated_at,
                    url: p.app_url,
                  })),
                  null,
                  2,
                ),
              },
            ],
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: handleBasecampError(error) }],
          };
        }
      },
    );

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/stefanoverna/basecamp-mcp'

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