Skip to main content
Glama
AnuwatThisuka

CMMS MCP Server

get_maintenance_history

Retrieve maintenance history from CMMS systems by filtering specific assets or date ranges to track equipment performance and maintenance activities.

Instructions

Get maintenance history from CMMS system. Can filter by asset or date range.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetIdNoFilter by asset ID
startDateNoStart date for history (ISO format)
endDateNoEnd date for history (ISO format)

Implementation Reference

  • Handler for the 'get_maintenance_history' tool, which filters maintenance history by optional assetId, startDate, and endDate.
    private handleGetMaintenanceHistory(args: {
      assetId?: string;
      startDate?: string;
      endDate?: string;
    }) {
      let history = [...mockMaintenanceHistory];
    
      if (args.assetId) {
        history = history.filter((h) => h.assetId === args.assetId);
      }
      if (args.startDate) {
        const start = new Date(args.startDate);
        history = history.filter((h) => new Date(h.completedDate) >= start);
      }
      if (args.endDate) {
        const end = new Date(args.endDate);
        history = history.filter((h) => new Date(h.completedDate) <= end);
      }
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(history, null, 2),
          },
        ],
      };
    }
  • src/index.ts:182-203 (registration)
    Registration of the 'get_maintenance_history' tool with its schema definition in the MCP server setup.
    {
      name: "get_maintenance_history",
      description:
        "Get maintenance history from CMMS system. Can filter by asset or date range.",
      inputSchema: {
        type: "object",
        properties: {
          assetId: {
            type: "string",
            description: "Filter by asset ID",
          },
          startDate: {
            type: "string",
            description: "Start date for history (ISO format)",
          },
          endDate: {
            type: "string",
            description: "End date for history (ISO format)",
          },
        },
      },
    },
  • src/index.ts:392-393 (registration)
    Tool request handler switch case for 'get_maintenance_history' that maps the request to its corresponding handler function.
    case "get_maintenance_history":
      return this.handleGetMaintenanceHistory(args as any);

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/AnuwatThisuka/cmms-mcp-server'

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