Get Login History
sf_get_login_historyQuery Salesforce login history to monitor user access and identify failed or suspicious attempts. Returns login time, username, IP, status, and login type for security audits.
Instructions
Queries LoginHistory to see user login activity — who logged in, from where, and whether they succeeded.
Returns records with: loginTime, username, sourceIp, browser, platform, status, loginType
status values: 'Success', 'Failed', 'No Password', 'Blocked', 'No Cookie' loginType values: 'Application', 'API', 'SAML', 'OAuth', 'LightningLogin', 'Chatter'
Useful for:
Security monitoring (failed logins, unusual IP addresses)
Compliance auditing (who accessed the org and when)
Investigating suspicious account activity
Note: LoginHistory covers the past 6 months.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum records to return | |
| status | No | Filter by login status, e.g. 'Success', 'Failed' | |
| endDate | No | End date in ISO format, e.g. '2025-12-31' | |
| username | No | Filter by Salesforce username | |
| startDate | No | Start date in ISO format, e.g. '2025-01-01' |