Skip to content

Add tools for creating themed and recurring invoices - #84

Open
ashokkumaru wants to merge 2 commits into
paypal:mainfrom
ashokkumaru:feature/ak/invoicing
Open

Add tools for creating themed and recurring invoices#84
ashokkumaru wants to merge 2 commits into
paypal:mainfrom
ashokkumaru:feature/ak/invoicing

Conversation

@ashokkumaru

Copy link
Copy Markdown

No description provided.

"args_schema": CreateRecurringSeriesParameters,
"actions": {"invoices": {"createRecurringSeries": True}},
"execute": create_recurring_series,
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user's underlying intent is simply "create an invoice," I'd suggest we consolidate rather than create separate tools per variant. Instead of having distinct tools, we could keep a single CREATE_INVOICE tool and add an invoice_type enum to its input schema (e.g., CREATE_INVOICE_WITH_THEME | CREATE_RECURRING_INVOICE, etc.). The LLM can then ask the user for any missing details (theme, recurrence settings, etc.) conversationally, rather than us needing separate tool definitions for each variant.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated as per your suggestion. Kept recurring invoice as separate tool since recurring is a separate resource and a lot of features are not supported by recurring invoices.

class ActivateRecurringSeriesParameters(BaseModel):
recurring_series_id: str = Field(..., description="The ID of the recurring invoice series to activate.", pattern=RECURRING_SERIES_ID_REGEX.pattern)


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark parameters as optional vs. required in the schema. Anything not required by the tool should be marked optional.

Tip: The tool's input schema doesn't need to mirror the actual API payload structure. Keep the schema simple and user/LLM-friendly — we can handle the transformation into the actual API request payload later, inside the method implementation.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cnallam, I've made all the optional fields as optional. Also as per your suggestion, I have updated the payload structure. Please review now

@ashokkumaru
ashokkumaru requested a review from cnallam July 30, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants