# Declare typed route parameters in an action

> Use the params option of NEWACTION so Total.js validates the URL parameters before your code runs.

Framework: total5
Product: Total.js 5 (total5@0.0.19)
Language: en
Content-SHA256: 4fe73fb1c01439a14bc08ee36ba7ee5d8cc02fd1d830a7477b8660e742faccf3
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: total5-installed@total5@0.0.19
Review: not-recorded

An action can describe the parameters it expects with `params`, using the same type names as `input`. UIDs are generated with `UID()` and include a checksum, so an arbitrary string is not a valid UID. When a parameter does not match its type, the framework answers with a validation error and your `action` function is not called.

```js definitions/items.js
NEWACTION('Items/read', {
	name: 'Read an item',
	params: 'id:UID',
	action: function($) {
		$.success($.params.id);
	}
});
```

```js controllers/items.js
exports.install = function() {
	ROUTE('GET /items/{id}/ --> *Items/read');
};
```
