First of all, as @adlawson, state you need to create a route that accept the parameter. By doing this you also give a name to this parameter. The code @adlawson proposed is good enough:
$route = new Zend_Controller_Router_Route(
':controller/:action/:id',
array(
'controller' => 'index',
'action' => 'index',
'id' => 0
),
array('id' => '\d+') // Makes sure :id is an int
);
$router = Zend_Controller_Front::getInstance()->getRouter();
$router->addRoute('myRouteName', $route);
Then, the simplest way, in the controller, to retrieve the value of the id from your url http://example.com/Controller/action/42 is the following :
public function indexAction () {
...
$id = $this->params()->fromRoute('id');
...
}
$this->_getAllParams()?