Repository navigation
Add the domain tools to the Python toolkit #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,8 @@ | |
| ListInboxItemsParams, | ||
| GetInboxParams, | ||
| CreateInboxParams, | ||
| GetDomainParams, | ||
| CreateDomainParams, | ||
| GetThreadParams, | ||
| GetAttachmentParams, | ||
| SendMessageParams, | ||
|
|
@@ -22,6 +24,11 @@ | |
| get_inbox, | ||
| create_inbox, | ||
| delete_inbox, | ||
| list_domains, | ||
| get_domain, | ||
| create_domain, | ||
| get_domain_setup_link, | ||
| verify_domain, | ||
| list_threads, | ||
| get_thread, | ||
| get_attachment, | ||
|
|
@@ -66,6 +73,69 @@ class Tool(BaseModel): | |
| params_schema=GetInboxParams, | ||
| func=delete_inbox, | ||
| ), | ||
| Tool( | ||
| name="list_domains", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Observation, not a defect.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed, a deliberate match with |
||
| description=( | ||
| "List custom email domains, paginated. Use get_domain for a domain's verification status and " | ||
| "DNS records. Requires the domain_read permission." | ||
| ), | ||
| params_schema=ListItemsParams, | ||
| func=list_domains, | ||
| ), | ||
| Tool( | ||
| name="get_domain", | ||
| description=( | ||
| "Get a custom email domain by ID: its verification status, the reason it is not verified yet, " | ||
| "and the DNS records to add at the domain's DNS provider, each with its own status and reason. " | ||
| "Requires the domain_read permission; inbox-scoped API keys cannot access domains." | ||
| ), | ||
| params_schema=GetDomainParams, | ||
| func=get_domain, | ||
| ), | ||
| Tool( | ||
| name="create_domain", | ||
| description=( | ||
| "Add a custom email domain. Returns it with status NOT_STARTED and the DNS records to add at the " | ||
| "domain's DNS provider. Next, call get_domain_setup_link for a one-click link that adds them, or " | ||
| "add them by hand, then call verify_domain. AgentMail receives the domain's mail, so adding its " | ||
| "MX record moves mail away from any provider the domain uses today. Fails with 422 when the " | ||
| "domain already receives mail through Google Workspace or Microsoft 365: suggest a subdomain such " | ||
| "as agents.example.com instead. Requires the domain_create permission." | ||
| ), | ||
| params_schema=CreateDomainParams, | ||
| func=create_domain, | ||
| ), | ||
| Tool( | ||
| name="get_domain_setup_link", | ||
| description=( | ||
| "Get a one-click link that adds a domain's DNS records at its DNS provider, when the provider " | ||
| "supports it (for example Cloudflare or Vercel). When supported is true, open url in a browser: " | ||
| "the domain owner signs in at provider_name, reviews the records and approves, and the provider " | ||
| "writes them; the browser then lands on the AgentMail console. When get_domain lists an MX " | ||
| "record, the link replaces the domain's current MX records, and mail to any provider the domain " | ||
| "uses today stops. conflicting_provider names such a provider when the check finds one, but the " | ||
| "check can miss it, so confirm with the user that the domain has no other mail provider before " | ||
| "opening such a link. When supported is false, add the records from get_domain by hand. Once the " | ||
| "records are in place, call verify_domain. Requires the domain_read permission." | ||
| ), | ||
| params_schema=GetDomainParams, | ||
| func=get_domain_setup_link, | ||
| ), | ||
| Tool( | ||
| name="verify_domain", | ||
| description=( | ||
| "Start verifying a domain once its DNS records are in place. Returns at once and the check runs " | ||
| "in the background: call get_domain to follow it until status is VERIFIED. Until then, the " | ||
| "domain's reason says what is left: a dns_records_* reason means a record is missing or wrong at " | ||
| "the DNS provider (each record has its own status and reason); ses_*_pending and " | ||
| "ses_*_temporary_failure clear on their own; ses_*_failed and ses_*_not_started need " | ||
| "verify_domain again once the records are right. DNS changes can take a while to be seen, so if " | ||
| "nothing changes after several checks, stop and tell the user the reason. Requires the " | ||
| "domain_update permission." | ||
| ), | ||
| params_schema=GetDomainParams, | ||
| func=verify_domain, | ||
| ), | ||
| Tool( | ||
| name="list_threads", | ||
| description="List threads in inbox", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Field description (nit).
get_domainalso returns the ID, not onlylist_domainsandcreate_domain.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving as is. The description names where an agent gets an ID it does not have yet. Calling
get_domainalready needs the ID, so it is not a source.