Add MTA Next Train community ability#227
Conversation
✅ Community PR Path Check — PassedAll changed files are inside the |
🔀 Branch Merge CheckPR direction: ✅ Passed — |
✅ Ability Validation Passed |
🔍 Lint Results✅
|
Added new keywords for northbound and southbound directions, enhanced exit phrases, and improved user prompts for station queries. Signed-off-by: Uzair Ullah <uzairullahmail@gmail.com>
uzair401
left a comment
There was a problem hiding this comment.
Hello @chadnewbry, I’ve implemented several fixes and improvements across SDK compliance, trigger flow, intent parsing, and voice UX.
Trigger handling is now improved by parsing intent directly from the trigger text, allowing actions like get/set default and help to work without unnecessary prompts. Intent parsing has also been enhanced to support more natural phrasing (e.g., “in”, “for”, “per”), added fallback handling for incomplete commands, improved disambiguation with ordinal support, and resolved duplicate station name issues.
Voice UX has been refined to sound more natural and conversational by expanding EXIT_WORDS, improving exit detection, shortening prompts and responses, removing repetitive instructions, adding confirmations where needed, and replacing formal phrasing with more natural speech patterns.
There is still room for further improvement, and I encourage you to continue building on this. For example, intent extraction from trigger phrases can be made more efficient (e.g., “When is the next train from Washington Square”), and after setting a default station, queries for other stations should not fall back to the default.
I am approving it for the community. We will proceed with adopting this ability for a 30-day evaluation period to monitor performance, identify any bugs, and implement any necessary fixes or optimizations. If the ability proves stable and meets our quality standards during this period, we will move forward with publishing it to the marketplace, ensuring full credit is given to the original author for their work and contribution. We truly appreciate your effort and encourage you to continue developing and submitting new abilities. Contributions like yours help strengthen the ecosystem, and we look forward to seeing more of your work.
Please open a new PR with the updated improvements when ready.
What does this Ability do?
🚇 Adds
MTA Next Train, a voice-first NYC subway arrivals ability for OpenHome. Users can save one default station for the fastest demo path, then ask things like "when's my next train?" or get more specific with line and station filters.Suggested Trigger Words
next trainnext subwaywhen's my next trainsubway arrivalsmtamta next trainType
External APIs
SubwayInfo.nycfor station search + live arrivals. No API key required.Testing
Local Verification
🚉 Fixture tests
python3 -m unittest discover -s community/mta-next-train/tests -v🚉 Ability validation
python3 validate_ability.py community/mta-next-train🚉 Local harness
python3 community/mta-next-train/test_harness.py --phrase "when is the next northbound 6 train at astor place"🚉 Live no-key endpoint check
python3 community/mta-next-train/test_harness.py --live --phrase "next 6 train at astor place"Example live output when tested locally:
Checklist
community/mta-next-train/main.pyfollows SDK pattern (extendsMatchingCapability, hasregister_capability+call)README.mdincluded with description, suggested triggers, and setupresume_normal_flow()called on every exit pathprint()in the ability runtime code — usingeditor_logging_handlerredis,user_config)asyncio.sleep()orasyncio.create_task()— usingsession_tasksAnything else?
🚆 Review route map:
main.pykeeps the OpenHome voice flow thinmta_next_train_core.pyholds the query parsing, station matching, and SubwayInfo clienttest_harness.pygives a quick way to demo both fixture mode and live mode🛤️ Fun demo path for review:
set my default station to Astor Placewhen's my next train?If this lands, it feels like a very clean subway-on-speakers demo: fast, specific, and zero setup friction for the user.