Skip to main content
Glama
asachs01

Autotask MCP Server

search_project_notes

Find project notes by entering a project ID to retrieve relevant information and updates for efficient project management.

Instructions

Search for notes on a specific project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesThe project ID to search notes for
pageSizeNoNumber of results to return (default: 25, max: 100)

Implementation Reference

  • Core handler implementation that queries the Autotask 'notes' API endpoint filtered by projectId, with optional pageSize pagination.
    async searchProjectNotes(projectId: number, options: AutotaskQueryOptionsExtended = {}): Promise<AutotaskProjectNote[]> {
      const client = await this.ensureClient();
      
      try {
        this.logger.debug(`Searching project notes for project ${projectId}:`, options);
        
        const optimizedOptions = {
          filter: [
            { field: 'projectId', op: 'eq', value: projectId }
          ],
          pageSize: options.pageSize || 25
        };
    
        const result = await client.notes.list(optimizedOptions);
        const notes = (result.data as any[]) || [];
        
        this.logger.info(`Retrieved ${notes.length} project notes`);
        return notes as AutotaskProjectNote[];
      } catch (error) {
        this.logger.error(`Failed to search project notes for project ${projectId}:`, error);
        throw error;
      }
    }
  • Input schema definition and tool registration metadata for the search_project_notes tool.
    {
      name: 'search_project_notes',
      description: 'Search for notes on a specific project',
      inputSchema: {
        type: 'object',
        properties: {
          projectId: {
            type: 'number',
            description: 'The project ID to search notes for'
          },
          pageSize: {
            type: 'number',
            description: 'Number of results to return (default: 25, max: 100)',
            minimum: 1,
            maximum: 100
          }
        },
        required: ['projectId']
      }
    },
  • Tool dispatch handler in callTool() method that delegates to AutotaskService.searchProjectNotes and formats the MCP response.
    case 'search_project_notes':
      result = await this.autotaskService.searchProjectNotes(args.projectId, { pageSize: args.pageSize });
      message = `Found ${result.length} project notes`;
      break;
  • MCP server registration of the generic listTools handler which exposes search_project_notes via the toolHandler.listTools().
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      try {
        this.logger.debug('Handling list tools request');
        const tools = await this.toolHandler.listTools();
        return { tools };
      } catch (error) {
        this.logger.error('Failed to list tools:', error);
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to list tools: ${error instanceof Error ? error.message : 'Unknown error'}`
        );
      }
    });
  • MCP server registration of the generic callTool handler which routes search_project_notes calls to the toolHandler.
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
      try {
        this.logger.debug(`Handling tool call: ${request.params.name}`);
        const result = await this.toolHandler.callTool(
          request.params.name,
          request.params.arguments || {}
        );
        return {
          content: result.content,
          isError: result.isError
        };
      } catch (error) {
        this.logger.error(`Failed to call tool ${request.params.name}:`, error);
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to call tool: ${error instanceof Error ? error.message : 'Unknown 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/asachs01/autotask-mcp'

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