Layi Docs
MCP Integration
Expose installed Layi service-template actions as controlled tools for frontier agents and copilots.
Agent-readable tools for installed apps
MCP is the best option when another agent, copilot, or frontier model needs to discover what a buyer’s installed Layi service can do. Each installed app exposes deterministic tool metadata backed by the same service-template contract used by the dashboard, SDK, and API.
For direct backend calls, use API Integration. For Python helpers around the same surface, use the SDK.
Routes
/services/{service_id}/mcp/toolsList the MCP tools exposed for one installed service.
/services/{service_id}/mcp/tools/{tool_name}/callCall one tool with JSON arguments.
List tools
Start with tool discovery. Tool names are deterministic and normalized from the installed service and action key, for example layi_service__svc_123__talent_list_volume_tier.
curl -s -H "X-API-Key: pk_xxx:sk_xxx" https://agent.layi.ai/services/svc_123/mcp/toolsCall a tool
MCP calls accept JSON arguments. The runtime validates schema, tenant scope, action access class, approval state, and compliance metadata before returning a result.
curl -s -H "X-API-Key: pk_xxx:sk_xxx" -H "Content-Type: application/json" -d '{"arguments":{"tier":"senior"}}' https://agent.layi.ai/services/svc_123/mcp/tools/layi_service__svc_123__talent_list_volume_tier/callAccess behavior
- Read tools by default
Discovery, list, lookup, summarize, and inspect-style actions are the safest starting point for external agents.
- Write/admin/export require allowlists
Sensitive tools are hidden unless the installed template, tenant policy, and integration surface permit them.
- Approvals still apply
If an action requires approval, the MCP call must include approved execution context or the runtime blocks it.
Approval-gated MCP calls
When an exposed tool maps to a sensitive action, include approval context after a human or policy system has approved the operation.
curl -s -H "X-API-Key: pk_xxx:sk_xxx" -H "Content-Type: application/json" -d '{ "arguments": {"pay_period":"2026-06"}, "approved_execution": true, "approval_note": "Approved by payroll owner in ticket PAY-1024" }' https://agent.layi.ai/services/svc_hr/mcp/tools/layi_service__svc_hr__hr_run_payroll/callRecommended agent posture
- Use read-only first
Start pilots with discovery and read tools before exposing state-changing operations.
- Keep customer keys separate
Use customer-scoped X-API-Key credentials for external tool access; never pass internal admin keys to frontier agents.
- Log partner references
Include a partner job or task reference when available so audit trails can be reconciled across systems.
Services & Apps
Install and operate the service templates before exposing them externally.