department_list
Retrieve all organizational departments from the Ashby hiring system. Use this tool to access department data for managing hiring workflows and candidate placement.
Instructions
List all departments.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| includeArchived | No | Include archived departments |
Implementation Reference
- src/ashby/server.py:407-434 (handler)The handler function routes tool calls to the Ashby API by looking up the endpoint in `TOOL_ENDPOINT_MAP`. The `department_list` tool uses this generic handler to call `/department.list`.
@server.call_tool() async def handle_call_tool(name: str, arguments: dict[str, Any]) -> list[types.TextContent]: """Route tool calls to the correct Ashby endpoint, passing arguments directly.""" endpoint = TOOL_ENDPOINT_MAP.get(name) if not endpoint: return [types.TextContent(type="text", text=f"Unknown tool: {name}")] try: # Pass arguments straight through -- tool schemas already use Ashby's # camelCase param names so no translation is needed. response = ashby.post(endpoint, data=arguments if arguments else None) return [types.TextContent(type="text", text=json.dumps(response, indent=2))] except requests.exceptions.HTTPError as e: error_body = "" if e.response is not None: try: error_body = e.response.text except Exception: pass return [ types.TextContent( type="text", text=f"Ashby API error on {endpoint}: {e}\n{error_body}", ) ] except Exception as e: return [types.TextContent(type="text", text=f"Error calling {endpoint}: {e}")] - src/ashby/server.py:325-334 (schema)The schema definition for `department_list` in the `TOOLS` list.
types.Tool( name="department_list", description="List all departments.", inputSchema={ "type": "object", "properties": { "includeArchived": {"type": "boolean", "description": "Include archived departments"}, }, }, ), - src/ashby/server.py:394-394 (registration)The registration mapping of the tool name to the API endpoint in `TOOL_ENDPOINT_MAP`.
"department_list": "/department.list",