Skip to main content
Glama
taiste
by taiste

list_users

Retrieve and manage user data in Harvest accounts, filtering by active status and pagination. Simplify user oversight with precise query parameters for efficient account administration.

Instructions

List all users in your Harvest account.

Args: is_active: Pass true to only return active users and false to return inactive users page: The page number for pagination per_page: The number of records to return per page (1-2000)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
is_activeNo
pageNo
per_pageNo

Implementation Reference

  • The handler function for the 'list_users' tool, decorated with @mcp.tool() for registration. It constructs parameters based on inputs and calls the Harvest API via harvest_request to list users, returning JSON.
    @mcp.tool() async def list_users(is_active: bool = None, page: int = None, per_page: int = None): """List all users in your Harvest account. Args: is_active: Pass true to only return active users and false to return inactive users page: The page number for pagination per_page: The number of records to return per page (1-2000) """ params = {} if is_active is not None: params["is_active"] = "true" if is_active else "false" else: params["is_active"] = "true" if page is not None: params["page"] = str(page) if per_page is not None: params["per_page"] = str(per_page) else: params["per_page"] = 200 response = await harvest_request("users", params) return json.dumps(response, indent=2)
  • Helper function used by list_users to make authenticated requests to the Harvest API.
    async def harvest_request(path, params=None, method="GET"): headers = { "Harvest-Account-Id": HARVEST_ACCOUNT_ID, "Authorization": f"Bearer {HARVEST_API_KEY}", "User-Agent": "Harvest MCP Server", "Content-Type": "application/json", } url = f"https://api.harvestapp.com/v2/{path}" async with httpx.AsyncClient() as client: if method == "GET": response = await client.get(url, headers=headers, params=params) else: response = await client.request(method, url, headers=headers, json=params) if response.status_code != 200: raise Exception( f"Harvest API Error: {response.status_code} {response.text}" ) return response.json()

Other Tools

Related 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/taiste/harvest-mcp-server'

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